Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
wine
wine-winehq
Commits
a058584d
Commit
a058584d
authored
Apr 20, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explicitly call VERSION_Init with the main exe file name, so that
application settings work for Win16 and DOS apps too.
parent
bc5b931d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
39 deletions
+32
-39
version.c
misc/version.c
+30
-39
process.c
scheduler/process.c
+2
-0
No files found.
misc/version.c
View file @
a058584d
...
@@ -332,14 +332,12 @@ static void VERSION_ParseVersion( HKEY hkey, BOOL *got_win_ver, BOOL *got_dos_ve
...
@@ -332,14 +332,12 @@ static void VERSION_ParseVersion( HKEY hkey, BOOL *got_win_ver, BOOL *got_dos_ve
/**********************************************************************
/**********************************************************************
* VERSION_Init
* VERSION_Init
*/
*/
static
void
VERSION_Init
(
void
)
void
VERSION_Init
(
const
char
*
appname
)
{
{
OBJECT_ATTRIBUTES
attr
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
;
UNICODE_STRING
nameW
;
HKEY
hkey
,
config_key
;
HKEY
hkey
,
config_key
;
BOOL
got_win_ver
=
FALSE
,
got_dos_ver
=
FALSE
;
BOOL
got_win_ver
=
FALSE
,
got_dos_ver
=
FALSE
;
WCHAR
buffer
[
MAX_PATH
],
appversion
[
MAX_PATH
+
20
],
*
appname
,
*
p
;
static
BOOL
init_done
;
static
const
WCHAR
configW
[]
=
{
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
static
const
WCHAR
configW
[]
=
{
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
...
@@ -348,17 +346,6 @@ static void VERSION_Init(void)
...
@@ -348,17 +346,6 @@ static void VERSION_Init(void)
static
const
WCHAR
appdefaultsW
[]
=
{
'A'
,
'p'
,
'p'
,
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
's'
,
'\\'
,
0
};
static
const
WCHAR
appdefaultsW
[]
=
{
'A'
,
'p'
,
'p'
,
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
's'
,
'\\'
,
0
};
static
const
WCHAR
versionW
[]
=
{
'\\'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
versionW
[]
=
{
'\\'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
0
};
if
(
init_done
)
return
;
if
(
!
GetModuleFileNameW
(
0
,
buffer
,
MAX_PATH
))
{
WARN
(
"could not get module file name
\n
"
);
return
;
}
init_done
=
TRUE
;
appname
=
buffer
;
if
((
p
=
strrchrW
(
appname
,
'/'
)))
appname
=
p
+
1
;
if
((
p
=
strrchrW
(
appname
,
'\\'
)))
appname
=
p
+
1
;
attr
.
Length
=
sizeof
(
attr
);
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
RootDirectory
=
0
;
attr
.
ObjectName
=
&
nameW
;
attr
.
ObjectName
=
&
nameW
;
...
@@ -371,20 +358,32 @@ static void VERSION_Init(void)
...
@@ -371,20 +358,32 @@ static void VERSION_Init(void)
attr
.
RootDirectory
=
config_key
;
attr
.
RootDirectory
=
config_key
;
/* open AppDefaults\\appname\\Version key */
/* open AppDefaults\\appname\\Version key */
if
(
appname
&&
*
appname
)
strcpyW
(
appversion
,
appdefaultsW
);
strcatW
(
appversion
,
appname
);
strcatW
(
appversion
,
versionW
);
RtlInitUnicodeString
(
&
nameW
,
appversion
);
if
(
!
NtOpenKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
))
{
{
VERSION_ParseVersion
(
hkey
,
&
got_win_ver
,
&
got_dos_ver
);
const
char
*
p
;
NtClose
(
hkey
);
DWORD
len
;
WCHAR
appversion
[
MAX_PATH
+
20
];
if
((
p
=
strrchr
(
appname
,
'/'
)))
appname
=
p
+
1
;
if
((
p
=
strrchr
(
appname
,
'\\'
)))
appname
=
p
+
1
;
strcpyW
(
appversion
,
appdefaultsW
);
len
=
strlenW
(
appversion
);
RtlMultiByteToUnicodeN
(
appversion
+
len
,
sizeof
(
appversion
)
-
len
*
sizeof
(
WCHAR
),
&
len
,
appname
,
strlen
(
appname
)
+
1
);
strcatW
(
appversion
,
versionW
);
TRACE
(
"getting version from %s
\n
"
,
debugstr_w
(
appversion
)
);
RtlInitUnicodeString
(
&
nameW
,
appversion
);
if
(
!
NtOpenKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
))
{
VERSION_ParseVersion
(
hkey
,
&
got_win_ver
,
&
got_dos_ver
);
NtClose
(
hkey
);
}
if
(
got_win_ver
&&
got_dos_ver
)
goto
done
;
}
}
if
(
got_win_ver
&&
got_dos_ver
)
goto
done
;
TRACE
(
"getting default version
\n
"
);
RtlInitUnicodeString
(
&
nameW
,
versionW
+
1
);
RtlInitUnicodeString
(
&
nameW
,
versionW
+
1
);
if
(
!
NtOpenKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
))
if
(
!
NtOpenKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
))
{
{
...
@@ -569,24 +568,16 @@ static WINDOWS_VERSION VERSION_GetVersion(void)
...
@@ -569,24 +568,16 @@ static WINDOWS_VERSION VERSION_GetVersion(void)
{
{
static
WORD
winver
=
0xffff
;
static
WORD
winver
=
0xffff
;
if
(
versionForced
)
return
forcedWinVersion
;
/* user has overridden any sensible checks */
if
(
winver
==
0xffff
)
/* to be determined */
if
(
winver
==
0xffff
)
/* to be determined */
{
{
WINDOWS_VERSION
retver
;
WINDOWS_VERSION
retver
=
VERSION_GetLinkedDllVersion
();
VERSION_Init
();
if
(
versionForced
)
/* user has overridden any sensible checks */
winver
=
forcedWinVersion
;
else
{
retver
=
VERSION_GetLinkedDllVersion
();
/* cache determined value, but do not store in case of WIN31 */
if
(
retver
!=
WIN31
)
winver
=
retver
;
return
retver
;
/* cache determined value, but do not store in case of WIN31 */
}
if
(
retver
!=
WIN31
)
winver
=
retver
;
return
retver
;
}
}
return
winver
;
return
winver
;
}
}
...
...
scheduler/process.c
View file @
a058584d
...
@@ -132,6 +132,7 @@ extern void PTHREAD_init_done(void);
...
@@ -132,6 +132,7 @@ extern void PTHREAD_init_done(void);
extern
void
RELAY_InitDebugLists
(
void
);
extern
void
RELAY_InitDebugLists
(
void
);
extern
BOOL
MAIN_MainInit
(
void
);
extern
BOOL
MAIN_MainInit
(
void
);
extern
void
VERSION_Init
(
const
char
*
appname
);
typedef
WORD
(
WINAPI
*
pUserSignalProc
)(
UINT
,
DWORD
,
DWORD
,
HMODULE16
);
typedef
WORD
(
WINAPI
*
pUserSignalProc
)(
UINT
,
DWORD
,
DWORD
,
HMODULE16
);
...
@@ -612,6 +613,7 @@ void PROCESS_InitWine( int argc, char *argv[], LPSTR win16_exe_name, HANDLE *win
...
@@ -612,6 +613,7 @@ void PROCESS_InitWine( int argc, char *argv[], LPSTR win16_exe_name, HANDLE *win
MESSAGE
(
"%s: cannot open builtin library for '%s': %s
\n
"
,
argv0
,
main_exe_name
,
error
);
MESSAGE
(
"%s: cannot open builtin library for '%s': %s
\n
"
,
argv0
,
main_exe_name
,
error
);
ExitProcess
(
1
);
ExitProcess
(
1
);
}
}
VERSION_Init
(
main_exe_name
);
switch
(
MODULE_GetBinaryType
(
main_exe_file
))
switch
(
MODULE_GetBinaryType
(
main_exe_file
))
{
{
...
...
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