Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
55cf2711
Commit
55cf2711
authored
Jan 15, 2013
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: force registry functions to ANSI mode
parent
d56c90bb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
modules/gui/qt4/util/registry.cpp
modules/gui/qt4/util/registry.cpp
+22
-22
No files found.
modules/gui/qt4/util/registry.cpp
View file @
55cf2711
...
@@ -42,7 +42,7 @@ QVLCRegistry::~QVLCRegistry( void )
...
@@ -42,7 +42,7 @@ QVLCRegistry::~QVLCRegistry( void )
bool
QVLCRegistry
::
RegistryKeyExists
(
const
char
*
path
)
bool
QVLCRegistry
::
RegistryKeyExists
(
const
char
*
path
)
{
{
HKEY
keyHandle
;
HKEY
keyHandle
;
if
(
RegOpenKeyEx
(
m_RootKey
,
path
,
0
,
KEY_READ
,
&
keyHandle
)
==
ERROR_SUCCESS
)
if
(
RegOpenKeyEx
A
(
m_RootKey
,
path
,
0
,
KEY_READ
,
&
keyHandle
)
==
ERROR_SUCCESS
)
{
{
RegCloseKey
(
keyHandle
);
RegCloseKey
(
keyHandle
);
return
true
;
return
true
;
...
@@ -57,9 +57,9 @@ bool QVLCRegistry::RegistryValueExists( const char *path, const char *valueName
...
@@ -57,9 +57,9 @@ bool QVLCRegistry::RegistryValueExists( const char *path, const char *valueName
DWORD
size1
;
DWORD
size1
;
DWORD
valueType
;
DWORD
valueType
;
if
(
RegOpenKeyEx
(
m_RootKey
,
path
,
0
,
KEY_READ
,
&
keyHandle
)
==
ERROR_SUCCESS
)
if
(
RegOpenKeyEx
A
(
m_RootKey
,
path
,
0
,
KEY_READ
,
&
keyHandle
)
==
ERROR_SUCCESS
)
{
{
if
(
RegQueryValueEx
(
keyHandle
,
valueName
,
NULL
,
if
(
RegQueryValueEx
A
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
NULL
,
&
size1
)
==
ERROR_SUCCESS
)
&
valueType
,
NULL
,
&
size1
)
==
ERROR_SUCCESS
)
{
{
temp
=
true
;
temp
=
true
;
...
@@ -73,10 +73,10 @@ void QVLCRegistry::WriteRegistryInt( const char *path, const char *valueName, in
...
@@ -73,10 +73,10 @@ void QVLCRegistry::WriteRegistryInt( const char *path, const char *valueName, in
{
{
HKEY
keyHandle
;
HKEY
keyHandle
;
if
(
RegCreateKeyEx
(
m_RootKey
,
path
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
if
(
RegCreateKeyEx
A
(
m_RootKey
,
path
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_WRITE
,
NULL
,
&
keyHandle
,
NULL
)
==
ERROR_SUCCESS
)
KEY_WRITE
,
NULL
,
&
keyHandle
,
NULL
)
==
ERROR_SUCCESS
)
{
{
RegSetValueEx
(
keyHandle
,
valueName
,
0
,
REG_DWORD
,
RegSetValueEx
A
(
keyHandle
,
valueName
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
value
,
sizeof
(
int
)
);
(
LPBYTE
)
&
value
,
sizeof
(
int
)
);
RegCloseKey
(
keyHandle
);
RegCloseKey
(
keyHandle
);
}
}
...
@@ -86,10 +86,10 @@ void QVLCRegistry::WriteRegistryString( const char *path, const char *valueName,
...
@@ -86,10 +86,10 @@ void QVLCRegistry::WriteRegistryString( const char *path, const char *valueName,
{
{
HKEY
keyHandle
;
HKEY
keyHandle
;
if
(
RegCreateKeyEx
(
m_RootKey
,
path
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
if
(
RegCreateKeyEx
A
(
m_RootKey
,
path
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_WRITE
,
NULL
,
&
keyHandle
,
NULL
)
==
ERROR_SUCCESS
)
KEY_WRITE
,
NULL
,
&
keyHandle
,
NULL
)
==
ERROR_SUCCESS
)
{
{
RegSetValueEx
(
keyHandle
,
valueName
,
0
,
REG_SZ
,
(
LPBYTE
)
value
,
RegSetValueEx
A
(
keyHandle
,
valueName
,
0
,
REG_SZ
,
(
LPBYTE
)
value
,
(
DWORD
)(
strlen
(
value
)
+
1
)
);
(
DWORD
)(
strlen
(
value
)
+
1
)
);
RegCloseKey
(
keyHandle
);
RegCloseKey
(
keyHandle
);
}
}
...
@@ -98,10 +98,10 @@ void QVLCRegistry::WriteRegistryString( const char *path, const char *valueName,
...
@@ -98,10 +98,10 @@ void QVLCRegistry::WriteRegistryString( const char *path, const char *valueName,
void
QVLCRegistry
::
WriteRegistryDouble
(
const
char
*
path
,
const
char
*
valueName
,
double
value
)
void
QVLCRegistry
::
WriteRegistryDouble
(
const
char
*
path
,
const
char
*
valueName
,
double
value
)
{
{
HKEY
keyHandle
;
HKEY
keyHandle
;
if
(
RegCreateKeyEx
(
m_RootKey
,
path
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
if
(
RegCreateKeyEx
A
(
m_RootKey
,
path
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_WRITE
,
NULL
,
&
keyHandle
,
NULL
)
==
ERROR_SUCCESS
)
KEY_WRITE
,
NULL
,
&
keyHandle
,
NULL
)
==
ERROR_SUCCESS
)
{
{
RegSetValueEx
(
keyHandle
,
valueName
,
0
,
REG_BINARY
,
(
LPBYTE
)
&
value
,
sizeof
(
double
)
);
RegSetValueEx
A
(
keyHandle
,
valueName
,
0
,
REG_BINARY
,
(
LPBYTE
)
&
value
,
sizeof
(
double
)
);
RegCloseKey
(
keyHandle
);
RegCloseKey
(
keyHandle
);
}
}
}
}
...
@@ -112,13 +112,13 @@ int QVLCRegistry::ReadRegistryInt( const char *path, const char *valueName, int
...
@@ -112,13 +112,13 @@ int QVLCRegistry::ReadRegistryInt( const char *path, const char *valueName, int
DWORD
size1
;
DWORD
size1
;
DWORD
valueType
;
DWORD
valueType
;
if
(
RegOpenKeyEx
(
m_RootKey
,
path
,
0
,
KEY_READ
,
&
keyHandle
)
==
ERROR_SUCCESS
)
if
(
RegOpenKeyEx
A
(
m_RootKey
,
path
,
0
,
KEY_READ
,
&
keyHandle
)
==
ERROR_SUCCESS
)
{
{
if
(
RegQueryValueEx
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
NULL
,
&
size1
)
==
ERROR_SUCCESS
)
if
(
RegQueryValueEx
A
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
NULL
,
&
size1
)
==
ERROR_SUCCESS
)
{
{
if
(
valueType
==
REG_DWORD
)
if
(
valueType
==
REG_DWORD
)
{
{
if
(
RegQueryValueEx
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
(
LPBYTE
)
&
tempValue
,
&
size1
)
==
ERROR_SUCCESS
)
if
(
RegQueryValueEx
A
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
(
LPBYTE
)
&
tempValue
,
&
size1
)
==
ERROR_SUCCESS
)
{
{
default_value
=
tempValue
;
default_value
=
tempValue
;
};
};
...
@@ -138,15 +138,15 @@ char * QVLCRegistry::ReadRegistryString( const char *path, const char *valueName
...
@@ -138,15 +138,15 @@ char * QVLCRegistry::ReadRegistryString( const char *path, const char *valueName
DWORD
size1
;
DWORD
size1
;
DWORD
valueType
;
DWORD
valueType
;
if
(
RegOpenKeyEx
(
m_RootKey
,
path
,
0
,
KEY_READ
,
&
keyHandle
)
==
ERROR_SUCCESS
)
if
(
RegOpenKeyEx
A
(
m_RootKey
,
path
,
0
,
KEY_READ
,
&
keyHandle
)
==
ERROR_SUCCESS
)
{
{
if
(
RegQueryValueEx
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
NULL
,
&
size1
)
==
ERROR_SUCCESS
)
if
(
RegQueryValueEx
A
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
NULL
,
&
size1
)
==
ERROR_SUCCESS
)
{
{
if
(
valueType
==
REG_SZ
)
if
(
valueType
==
REG_SZ
)
{
{
// free
// free
tempValue
=
(
char
*
)
malloc
(
size1
+
1
);
// +1 für NullByte`?
tempValue
=
(
char
*
)
malloc
(
size1
+
1
);
// +1 für NullByte`?
if
(
RegQueryValueEx
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
(
LPBYTE
)
tempValue
,
&
size1
)
==
ERROR_SUCCESS
)
if
(
RegQueryValueEx
A
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
(
LPBYTE
)
tempValue
,
&
size1
)
==
ERROR_SUCCESS
)
{
{
tempValue2
=
tempValue
;
tempValue2
=
tempValue
;
};
};
...
@@ -165,14 +165,14 @@ double QVLCRegistry::ReadRegistryDouble( const char *path, const char *valueName
...
@@ -165,14 +165,14 @@ double QVLCRegistry::ReadRegistryDouble( const char *path, const char *valueName
DWORD
size1
;
DWORD
size1
;
DWORD
valueType
;
DWORD
valueType
;
if
(
RegOpenKeyEx
(
m_RootKey
,
path
,
0
,
KEY_READ
,
&
keyHandle
)
==
ERROR_SUCCESS
)
if
(
RegOpenKeyEx
A
(
m_RootKey
,
path
,
0
,
KEY_READ
,
&
keyHandle
)
==
ERROR_SUCCESS
)
{
{
if
(
RegQueryValueEx
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
if
(
RegQueryValueEx
A
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
NULL
,
&
size1
)
==
ERROR_SUCCESS
)
NULL
,
&
size1
)
==
ERROR_SUCCESS
)
{
{
if
(
(
valueType
==
REG_BINARY
)
&&
(
size1
==
sizeof
(
double
)
)
)
if
(
(
valueType
==
REG_BINARY
)
&&
(
size1
==
sizeof
(
double
)
)
)
{
{
if
(
RegQueryValueEx
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
if
(
RegQueryValueEx
A
(
keyHandle
,
valueName
,
NULL
,
&
valueType
,
(
LPBYTE
)
&
tempValue
,
&
size1
)
==
ERROR_SUCCESS
)
(
LPBYTE
)
&
tempValue
,
&
size1
)
==
ERROR_SUCCESS
)
{
{
default_value
=
tempValue
;
default_value
=
tempValue
;
...
@@ -188,9 +188,9 @@ int QVLCRegistry::DeleteValue( const char *path, const char *valueName )
...
@@ -188,9 +188,9 @@ int QVLCRegistry::DeleteValue( const char *path, const char *valueName )
{
{
HKEY
keyHandle
;
HKEY
keyHandle
;
long
result
;
long
result
;
if
(
(
result
=
RegOpenKeyEx
(
m_RootKey
,
path
,
0
,
KEY_WRITE
,
&
keyHandle
))
==
ERROR_SUCCESS
)
if
(
(
result
=
RegOpenKeyEx
A
(
m_RootKey
,
path
,
0
,
KEY_WRITE
,
&
keyHandle
))
==
ERROR_SUCCESS
)
{
{
result
=
RegDeleteValue
(
keyHandle
,
valueName
);
result
=
RegDeleteValue
A
(
keyHandle
,
valueName
);
RegCloseKey
(
keyHandle
);
RegCloseKey
(
keyHandle
);
}
}
//ERROR_SUCCESS = ok everything else you have a problem*g*,
//ERROR_SUCCESS = ok everything else you have a problem*g*,
...
@@ -201,12 +201,12 @@ long QVLCRegistry::DeleteKey( const char *path, const char *keyName )
...
@@ -201,12 +201,12 @@ long QVLCRegistry::DeleteKey( const char *path, const char *keyName )
{
{
HKEY
keyHandle
;
HKEY
keyHandle
;
long
result
;
long
result
;
if
(
(
result
=
RegOpenKeyEx
(
m_RootKey
,
path
,
0
,
KEY_WRITE
,
&
keyHandle
))
==
ERROR_SUCCESS
)
if
(
(
result
=
RegOpenKeyEx
A
(
m_RootKey
,
path
,
0
,
KEY_WRITE
,
&
keyHandle
))
==
ERROR_SUCCESS
)
{
{
// be warned the key "keyName" will not be deleted if there are subkeys below him, values
// be warned the key "keyName" will not be deleted if there are subkeys below him, values
// I think are ok and will be recusively deleted, but not keys...
// I think are ok and will be recusively deleted, but not keys...
// for this case we have to do a little bit more work!
// for this case we have to do a little bit more work!
result
=
RegDeleteKey
(
keyHandle
,
keyName
);
result
=
RegDeleteKey
A
(
keyHandle
,
keyName
);
RegCloseKey
(
keyHandle
);
RegCloseKey
(
keyHandle
);
}
}
//ERROR_SUCCESS = ok everything else you have a problem*g*,
//ERROR_SUCCESS = ok everything else you have a problem*g*,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment