Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr Isakov
wine-fonts
Commits
aad2fe3b
Commit
aad2fe3b
authored
Aug 17, 2005
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Aug 17, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add windows version registry entries.
parent
2c0e97e6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
82 deletions
+133
-82
appdefaults.c
programs/winecfg/appdefaults.c
+87
-16
properties.c
programs/winecfg/properties.c
+0
-48
properties.h
programs/winecfg/properties.h
+0
-10
winecfg.c
programs/winecfg/winecfg.c
+45
-8
winecfg.h
programs/winecfg/winecfg.h
+1
-0
No files found.
programs/winecfg/appdefaults.c
View file @
aad2fe3b
...
...
@@ -32,10 +32,38 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
winecfg
);
static
const
struct
{
const
char
*
szVersion
;
const
char
*
szDescription
;
DWORD
dwMajorVersion
;
DWORD
dwMinorVersion
;
DWORD
dwBuildNumber
;
DWORD
dwPlatformId
;
const
char
*
szCSDVersion
;
WORD
wServicePackMajor
;
WORD
wServicePackMinor
;
const
char
*
szProductType
;
}
win_versions
[]
=
{
{
"win2003"
,
"Windows 2003"
,
5
,
2
,
0xECE
,
VER_PLATFORM_WIN32_NT
,
"Service Pack 1"
,
1
,
0
,
"ServerNT"
},
{
"winxp"
,
"Windows XP"
,
5
,
1
,
0xA28
,
VER_PLATFORM_WIN32_NT
,
"Service Pack 2"
,
2
,
0
,
"WinNT"
},
{
"win2k"
,
"Windows 2000"
,
5
,
0
,
0x893
,
VER_PLATFORM_WIN32_NT
,
"Service Pack 4"
,
4
,
0
,
"WinNT"
},
{
"winme"
,
"Windows ME"
,
4
,
90
,
0xBB8
,
VER_PLATFORM_WIN32_WINDOWS
,
" "
,
0
,
0
,
""
},
{
"win98"
,
"Windows 98"
,
4
,
10
,
0x8AE
,
VER_PLATFORM_WIN32_WINDOWS
,
" A "
,
0
,
0
,
""
},
{
"win95"
,
"Windows 95"
,
4
,
0
,
0x3B6
,
VER_PLATFORM_WIN32_WINDOWS
,
""
,
0
,
0
,
""
},
{
"nt40"
,
"Windows NT 4.0"
,
4
,
0
,
0x565
,
VER_PLATFORM_WIN32_NT
,
"Service Pack 6a"
,
6
,
0
,
"WinNT"
},
{
"nt351"
,
"Windows NT 3.5"
,
3
,
51
,
0x421
,
VER_PLATFORM_WIN32_NT
,
"Service Pack 2"
,
0
,
0
,
"WinNT"
},
{
"win31"
,
"Windows 3.1"
,
2
,
10
,
0
,
VER_PLATFORM_WIN32s
,
"Win32s 1.3"
,
0
,
0
,
""
},
{
"win30"
,
"Windows 3.0"
,
3
,
0
,
0
,
VER_PLATFORM_WIN32s
,
"Win32s 1.3"
,
0
,
0
,
""
},
{
"win20"
,
"Windows 2.0"
,
2
,
0
,
0
,
VER_PLATFORM_WIN32s
,
"Win32s 1.3"
,
0
,
0
,
""
}
};
#define NB_VERSIONS (sizeof(win_versions)/sizeof(win_versions[0]))
static
void
update_comboboxes
(
HWND
dialog
)
{
int
i
;
const
VERSION_DESC
*
pVer
=
NULL
;
char
*
winver
;
...
...
@@ -48,17 +76,14 @@ static void update_comboboxes(HWND dialog)
/* normalize the version strings */
if
(
*
winver
!=
'\0'
)
{
if
((
pVer
=
getWinVersions
()))
{
for
(
i
=
0
;
*
pVer
->
szVersion
||
*
pVer
->
szDescription
;
i
++
,
pVer
++
)
for
(
i
=
0
;
i
<
NB_VERSIONS
;
i
++
)
{
if
(
!
strcasecmp
(
pVer
->
szVersion
,
winver
))
if
(
!
strcasecmp
(
win_versions
[
i
].
szVersion
,
winver
))
{
SendDlgItemMessage
(
dialog
,
IDC_WINVER
,
CB_SETCURSEL
,
(
WPARAM
)
(
i
+
1
),
0
);
WINE_TRACE
(
"match with %s
\n
"
,
pVer
->
szVersion
);
WINE_TRACE
(
"match with %s
\n
"
,
win_versions
[
i
].
szVersion
);
}
}
}
}
else
/* no explicit setting */
{
...
...
@@ -73,7 +98,6 @@ static void
init_comboboxes
(
HWND
dialog
)
{
int
i
;
const
VERSION_DESC
*
ver
=
NULL
;
SendDlgItemMessage
(
dialog
,
IDC_WINVER
,
CB_RESETCONTENT
,
0
,
0
);
...
...
@@ -87,14 +111,11 @@ init_comboboxes (HWND dialog)
SendDlgItemMessage
(
dialog
,
IDC_WINVER
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
"Automatically detect required version"
);
}
if
((
ver
=
getWinVersions
()))
{
for
(
i
=
0
;
*
ver
->
szVersion
||
*
ver
->
szDescription
;
i
++
,
ver
++
)
for
(
i
=
0
;
i
<
NB_VERSIONS
;
i
++
)
{
SendDlgItemMessage
(
dialog
,
IDC_WINVER
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
ver
->
szDescription
);
0
,
(
LPARAM
)
win_versions
[
i
].
szDescription
);
}
}
}
static
void
add_listview_item
(
HWND
listview
,
const
char
*
text
,
void
*
association
)
...
...
@@ -291,7 +312,6 @@ static void on_remove_app_click(HWND dialog)
static
void
on_winver_change
(
HWND
dialog
)
{
int
selection
=
SendDlgItemMessage
(
dialog
,
IDC_WINVER
,
CB_GETCURSEL
,
0
,
0
);
const
VERSION_DESC
*
ver
=
getWinVersions
();
if
(
selection
==
0
)
{
...
...
@@ -300,8 +320,59 @@ static void on_winver_change(HWND dialog)
}
else
{
WINE_TRACE
(
"setting Version key to value '%s'
\n
"
,
ver
[
selection
-
1
].
szVersion
);
set_reg_key
(
config_key
,
keypath
(
""
),
"Version"
,
ver
[
selection
-
1
].
szVersion
);
WINE_TRACE
(
"setting Version key to value '%s'
\n
"
,
win_versions
[
selection
-
1
].
szVersion
);
set_reg_key
(
config_key
,
keypath
(
""
),
"Version"
,
win_versions
[
selection
-
1
].
szVersion
);
}
/* global version only */
if
(
!
current_app
&&
selection
!=
0
)
{
static
const
char
szKey9x
[]
=
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion"
;
static
const
char
szKeyNT
[]
=
"Software
\\
Microsoft
\\
Windows NT
\\
CurrentVersion"
;
static
const
char
szKeyProdNT
[]
=
"System
\\
CurrentControlSet
\\
Control
\\
ProductOptions"
;
static
const
char
szKeyWindNT
[]
=
"System
\\
CurrentControlSet
\\
Control
\\
Windows"
;
char
Buffer
[
40
];
switch
(
win_versions
[
selection
-
1
].
dwPlatformId
)
{
case
VER_PLATFORM_WIN32_WINDOWS
:
snprintf
(
Buffer
,
sizeof
(
Buffer
),
"%ld.%ld.%ld"
,
win_versions
[
selection
-
1
].
dwMajorVersion
,
win_versions
[
selection
-
1
].
dwMinorVersion
,
win_versions
[
selection
-
1
].
dwBuildNumber
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKey9x
,
"VersionNumber"
,
Buffer
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKey9x
,
"SubVersionNumber"
,
win_versions
[
selection
-
1
].
szCSDVersion
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKeyNT
,
"CSDVersion"
,
NULL
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKeyNT
,
"CurrentVersion"
,
NULL
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKeyNT
,
"CurrentBuildNumber"
,
NULL
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKeyProdNT
,
"ProductType"
,
NULL
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKeyWindNT
,
"CSDVersion"
,
NULL
);
break
;
case
VER_PLATFORM_WIN32_NT
:
snprintf
(
Buffer
,
sizeof
(
Buffer
),
"%ld.%ld"
,
win_versions
[
selection
-
1
].
dwMajorVersion
,
win_versions
[
selection
-
1
].
dwMinorVersion
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKeyNT
,
"CurrentVersion"
,
Buffer
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKeyNT
,
"CSDVersion"
,
win_versions
[
selection
-
1
].
szCSDVersion
);
snprintf
(
Buffer
,
sizeof
(
Buffer
),
"%ld"
,
win_versions
[
selection
-
1
].
dwBuildNumber
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKeyNT
,
"CurrentBuildNumber"
,
Buffer
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKeyProdNT
,
"ProductType"
,
win_versions
[
selection
-
1
].
szProductType
);
set_reg_key_dword
(
HKEY_LOCAL_MACHINE
,
szKeyWindNT
,
"CSDVersion"
,
MAKEWORD
(
win_versions
[
selection
-
1
].
wServicePackMinor
,
win_versions
[
selection
-
1
].
wServicePackMajor
));
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKey9x
,
"VersionNumber"
,
NULL
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKey9x
,
"SubVersionNumber"
,
NULL
);
break
;
case
VER_PLATFORM_WIN32s
:
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKeyNT
,
"CSDVersion"
,
NULL
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKeyNT
,
"CurrentVersion"
,
NULL
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKeyNT
,
"CurrentBuildNumber"
,
NULL
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKeyProdNT
,
"ProductType"
,
NULL
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKeyWindNT
,
"CSDVersion"
,
NULL
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKey9x
,
"VersionNumber"
,
NULL
);
set_reg_key
(
HKEY_LOCAL_MACHINE
,
szKey9x
,
"SubVersionNumber"
,
NULL
);
break
;
}
}
/* enable the apply button */
...
...
programs/winecfg/properties.c
View file @
aad2fe3b
...
...
@@ -24,21 +24,6 @@
#include "properties.h"
static
const
VERSION_DESC
sWinVersions
[]
=
{
{
"win2003"
,
"Windows 2003"
},
{
"winxp"
,
"Windows XP"
},
{
"win2k"
,
"Windows 2000"
},
{
"winme"
,
"Windows ME"
},
{
"win98"
,
"Windows 98"
},
{
"win95"
,
"Windows 95"
},
{
"nt40"
,
"Windows NT 4.0"
},
{
"nt351"
,
"Windows NT 3.5"
},
{
"win31"
,
"Windows 3.1"
},
{
"win30"
,
"Windows 3.0"
},
{
"win20"
,
"Windows 2.0"
},
{
""
,
""
}
};
static
const
DLL_DESC
sDLLType
[]
=
{
{
"oleaut32"
,
DLL_BUILTIN
},
{
"ole32"
,
DLL_BUILTIN
},
...
...
@@ -68,15 +53,6 @@ static const AUDIO_DRIVER sAudioDrivers[] = {
{
"Disable sound"
,
""
},
{
""
,
""
}
};
/*****************************************************************************
*/
const
VERSION_DESC
*
getWinVersions
(
void
)
{
return
sWinVersions
;
}
/*****************************************************************************
...
...
@@ -92,27 +68,3 @@ const AUDIO_DRIVER* getAudioDrivers(void)
{
return
sAudioDrivers
;
}
/* Functions to convert from version to description and back */
char
*
getVersionFromDescription
(
VERSION_DESC
*
pVer
,
char
*
desc
)
{
for
(;
*
pVer
->
szVersion
;
pVer
++
)
{
if
(
!
strcasecmp
(
pVer
->
szDescription
,
desc
))
return
pVer
->
szVersion
;
}
return
NULL
;
}
char
*
getDescriptionFromVersion
(
VERSION_DESC
*
pVer
,
char
*
ver
)
{
for
(;
*
pVer
->
szDescription
;
pVer
++
)
{
if
(
!
strcasecmp
(
pVer
->
szVersion
,
ver
))
return
pVer
->
szDescription
;
}
return
NULL
;
}
programs/winecfg/properties.h
View file @
aad2fe3b
...
...
@@ -37,12 +37,6 @@
#define MAX_VERSION_LENGTH 48
#define MAX_DESCRIPTION_LENGTH 128
typedef
struct
{
char
szVersion
[
MAX_VERSION_LENGTH
];
char
szDescription
[
MAX_DESCRIPTION_LENGTH
];
}
VERSION_DESC
;
#define DLL_NATIVE 0x0000
#define DLL_BUILTIN 0x0001
...
...
@@ -93,11 +87,7 @@ typedef struct
int
nType
;
}
DEV_NODES
;
const
VERSION_DESC
*
getWinVersions
(
void
);
const
VERSION_DESC
*
getDOSVersions
(
void
);
const
DLL_DESC
*
getDLLDefaults
(
void
);
const
AUDIO_DRIVER
*
getAudioDrivers
(
void
);
char
*
getVersionFromDescription
(
VERSION_DESC
*
pVer
,
char
*
desc
);
char
*
getDescriptionFromVersion
(
VERSION_DESC
*
pVer
,
char
*
ver
);
#endif
programs/winecfg/winecfg.c
View file @
aad2fe3b
...
...
@@ -139,11 +139,11 @@ end:
*
* If valueName or value is NULL, an empty section will be created
*/
static
int
set_config_key
(
HKEY
root
,
const
char
*
subkey
,
const
char
*
name
,
const
char
*
valu
e
)
{
static
int
set_config_key
(
HKEY
root
,
const
char
*
subkey
,
const
char
*
name
,
const
BYTE
*
value
,
DWORD
typ
e
)
{
DWORD
res
=
1
;
HKEY
key
=
NULL
;
WINE_TRACE
(
"subkey=%s: name=%s, value=%s
\n
"
,
subkey
,
name
,
valu
e
);
WINE_TRACE
(
"subkey=%s: name=%s, value=%s
, type=%ld
\n
"
,
subkey
,
name
,
value
,
typ
e
);
assert
(
subkey
!=
NULL
);
...
...
@@ -155,7 +155,11 @@ static int set_config_key(HKEY root, const char *subkey, const char *name, const
else
key
=
root
;
if
(
name
==
NULL
||
value
==
NULL
)
goto
end
;
res
=
RegSetValueEx
(
key
,
name
,
0
,
REG_SZ
,
value
,
strlen
(
value
)
+
1
);
switch
(
type
)
{
case
REG_SZ
:
res
=
RegSetValueEx
(
key
,
name
,
0
,
REG_SZ
,
value
,
strlen
(
value
)
+
1
);
break
;
case
REG_DWORD
:
res
=
RegSetValueEx
(
key
,
name
,
0
,
REG_DWORD
,
value
,
sizeof
(
DWORD
));
break
;
}
if
(
res
!=
ERROR_SUCCESS
)
goto
end
;
res
=
0
;
...
...
@@ -213,6 +217,7 @@ struct setting
char
*
path
;
/* path in the registry rooted at root */
char
*
name
;
/* name of the registry value. if null, this means delete the key */
char
*
value
;
/* contents of the registry value. if null, this means delete the value */
DWORD
type
;
/* type of registry value. REG_SZ or REG_DWORD for now */
};
struct
list
*
settings
;
...
...
@@ -281,16 +286,18 @@ char *get_reg_key(HKEY root, const char *path, const char *name, const char *def
*
* value is what to set the value to, or NULL to delete it.
*
* type is REG_SZ or REG_DWORD.
*
* These values will be copied when necessary.
*/
void
set_reg_key
(
HKEY
root
,
const
char
*
path
,
const
char
*
name
,
const
char
*
valu
e
)
static
void
set_reg_key_ex
(
HKEY
root
,
const
char
*
path
,
const
char
*
name
,
const
void
*
value
,
DWORD
typ
e
)
{
struct
list
*
cursor
;
struct
setting
*
s
;
assert
(
path
!=
NULL
);
WINE_TRACE
(
"path=%s, name=%s, value=%
s
\n
"
,
path
,
name
,
value
);
WINE_TRACE
(
"path=%s, name=%s, value=%
p
\n
"
,
path
,
name
,
value
);
/* firstly, see if we already set this setting */
LIST_FOR_EACH
(
cursor
,
settings
)
...
...
@@ -309,7 +316,17 @@ void set_reg_key(HKEY root, const char *path, const char *name, const char *valu
/* yes, we have already set it, so just replace the content and return */
HeapFree
(
GetProcessHeap
(),
0
,
s
->
value
);
s
->
value
=
value
?
strdupA
(
value
)
:
NULL
;
s
->
type
=
type
;
switch
(
type
)
{
case
REG_SZ
:
s
->
value
=
value
?
strdupA
(
value
)
:
NULL
;
break
;
case
REG_DWORD
:
s
->
value
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DWORD
));
memcpy
(
s
->
value
,
value
,
sizeof
(
DWORD
)
);
break
;
}
/* are we deleting this key? this won't remove any of the
* children from the overlay so if the user adds it again in
...
...
@@ -329,11 +346,31 @@ void set_reg_key(HKEY root, const char *path, const char *name, const char *valu
s
->
root
=
root
;
s
->
path
=
strdupA
(
path
);
s
->
name
=
name
?
strdupA
(
name
)
:
NULL
;
s
->
value
=
value
?
strdupA
(
value
)
:
NULL
;
s
->
type
=
type
;
switch
(
type
)
{
case
REG_SZ
:
s
->
value
=
value
?
strdupA
(
value
)
:
NULL
;
break
;
case
REG_DWORD
:
s
->
value
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DWORD
));
memcpy
(
s
->
value
,
value
,
sizeof
(
DWORD
)
);
break
;
}
list_add_tail
(
settings
,
&
s
->
entry
);
}
void
set_reg_key
(
HKEY
root
,
const
char
*
path
,
const
char
*
name
,
const
char
*
value
)
{
set_reg_key_ex
(
root
,
path
,
name
,
value
,
REG_SZ
);
}
void
set_reg_key_dword
(
HKEY
root
,
const
char
*
path
,
const
char
*
name
,
DWORD
value
)
{
set_reg_key_ex
(
root
,
path
,
name
,
&
value
,
REG_DWORD
);
}
/**
* enumerates the value names at the given path, taking into account
* the changes in the settings list.
...
...
@@ -466,7 +503,7 @@ static void process_setting(struct setting *s)
if
(
s
->
value
)
{
WINE_TRACE
(
"Setting %s:%s to '%s'
\n
"
,
s
->
path
,
s
->
name
,
s
->
value
);
set_config_key
(
s
->
root
,
s
->
path
,
s
->
name
,
s
->
value
);
set_config_key
(
s
->
root
,
s
->
path
,
s
->
name
,
s
->
value
,
s
->
type
);
}
else
{
...
...
programs/winecfg/winecfg.h
View file @
aad2fe3b
...
...
@@ -52,6 +52,7 @@ extern char *current_app; /* NULL means editing global settings */
*/
void
set_reg_key
(
HKEY
root
,
const
char
*
path
,
const
char
*
name
,
const
char
*
value
);
void
set_reg_key_dword
(
HKEY
root
,
const
char
*
path
,
const
char
*
name
,
DWORD
value
);
char
*
get_reg_key
(
HKEY
root
,
const
char
*
path
,
const
char
*
name
,
const
char
*
def
);
BOOL
reg_key_exists
(
HKEY
root
,
const
char
*
path
,
const
char
*
name
);
void
apply
(
void
);
...
...
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