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
ed20ac87
Commit
ed20ac87
authored
Apr 16, 2009
by
Rein Klazes
Committed by
Alexandre Julliard
Apr 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Do not set the windows version to 0.5.
parent
e00d864a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
12 deletions
+56
-12
data.c
dlls/msvcrt/data.c
+18
-12
data.c
dlls/msvcrt/tests/data.c
+38
-0
No files found.
dlls/msvcrt/data.c
View file @
ed20ac87
...
...
@@ -262,7 +262,7 @@ unsigned int CDECL MSVCRT____setlc_active_func(void)
*/
void
msvcrt_init_args
(
void
)
{
DWORD
version
;
OSVERSIONINFOW
osvi
;
MSVCRT__acmdln
=
_strdup
(
GetCommandLineA
()
);
MSVCRT__wcmdln
=
msvcrt_wstrdupa
(
MSVCRT__acmdln
);
...
...
@@ -273,17 +273,23 @@ void msvcrt_init_args(void)
TRACE
(
"got %s, wide = %s argc=%d
\n
"
,
debugstr_a
(
MSVCRT__acmdln
),
debugstr_w
(
MSVCRT__wcmdln
),
MSVCRT___argc
);
version
=
GetVersion
();
MSVCRT__osver
=
version
>>
16
;
MSVCRT__winminor
=
version
&
0xFF
;
MSVCRT__winmajor
=
(
version
>>
8
)
&
0xFF
;
MSVCRT_baseversion
=
version
>>
16
;
MSVCRT__winver
=
((
version
>>
8
)
&
0xFF
)
+
((
version
&
0xFF
)
<<
8
);
MSVCRT_baseminor
=
(
version
>>
16
)
&
0xFF
;
MSVCRT_basemajor
=
(
version
>>
24
)
&
0xFF
;
MSVCRT_osversion
=
version
&
0xFFFF
;
MSVCRT_osminor
=
version
&
0xFF
;
MSVCRT_osmajor
=
(
version
>>
8
)
&
0xFF
;
osvi
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFOW
);
GetVersionExW
(
&
osvi
);
MSVCRT__winver
=
(
osvi
.
dwMajorVersion
<<
8
)
|
osvi
.
dwMinorVersion
;
MSVCRT__winmajor
=
osvi
.
dwMajorVersion
;
MSVCRT__winminor
=
osvi
.
dwMinorVersion
;
MSVCRT__osver
=
osvi
.
dwBuildNumber
;
MSVCRT_osversion
=
MSVCRT__winver
;
MSVCRT_osmajor
=
MSVCRT__winmajor
;
MSVCRT_osminor
=
MSVCRT__winminor
;
MSVCRT_baseversion
=
MSVCRT__osver
;
MSVCRT_baseminor
=
MSVCRT_baseversion
&
0xFF
;
MSVCRT_basemajor
=
(
MSVCRT_baseversion
>>
8
)
&
0xFF
;
TRACE
(
"winver %08x winmajor %08x winminor %08x osver%08x baseversion %08x basemajor %08x baseminor %08x
\n
"
,
MSVCRT__winver
,
MSVCRT__winmajor
,
MSVCRT__winminor
,
MSVCRT__osver
,
MSVCRT_baseversion
,
MSVCRT_basemajor
,
MSVCRT_baseminor
);
TRACE
(
"osversion %08x osmajor %08x osminor %08x
\n
"
,
MSVCRT_osversion
,
MSVCRT_osmajor
,
MSVCRT_osminor
);
MSVCRT__HUGE
=
HUGE_VAL
;
MSVCRT___setlc_active
=
0
;
MSVCRT___unguarded_readlc_active
=
0
;
...
...
dlls/msvcrt/tests/data.c
View file @
ed20ac87
...
...
@@ -67,13 +67,51 @@ static void test_initterm(void)
initterm_test
(
&
callbacks
[
0
],
&
callbacks
[
3
],
2
);
}
static
void
test_initvar
(
HMODULE
hmsvcrt
)
{
OSVERSIONINFO
osvi
=
{
sizeof
(
OSVERSIONINFO
)
};
int
*
(
*
pp_winver
)()
=
(
int
*
(
*
)())
GetProcAddress
(
hmsvcrt
,
"__p__winver"
);
int
*
(
*
pp_winmajor
)()
=
(
int
*
(
*
)())
GetProcAddress
(
hmsvcrt
,
"__p__winmajor"
);
int
*
(
*
pp_winminor
)()
=
(
int
*
(
*
)())
GetProcAddress
(
hmsvcrt
,
"__p__winminor"
);
int
*
(
*
pp_osver
)()
=
(
int
*
(
*
)())
GetProcAddress
(
hmsvcrt
,
"__p__osver"
);
int
winver
,
winmajor
,
winminor
,
osver
;
if
(
!
(
pp_winmajor
&&
pp_winminor
&&
pp_winver
))
{
win_skip
(
"_winver variables are not available
\n
"
);
return
;
}
winver
=
*
pp_winver
();
winminor
=
*
pp_winminor
();
winmajor
=
*
pp_winmajor
();
GetVersionEx
(
&
osvi
);
ok
(
winminor
==
osvi
.
dwMinorVersion
,
"Wrong value for _winminor %02x expected %02x
\n
"
,
winminor
,
osvi
.
dwMinorVersion
);
ok
(
winmajor
==
osvi
.
dwMajorVersion
,
"Wrong value for _winmajor %02x expected %02x
\n
"
,
winmajor
,
osvi
.
dwMajorVersion
);
ok
(
winver
==
((
osvi
.
dwMajorVersion
<<
8
)
|
osvi
.
dwMinorVersion
),
"Wrong value for _winver %02x expected %02x
\n
"
,
winver
,
((
osvi
.
dwMajorVersion
<<
8
)
|
osvi
.
dwMinorVersion
));
if
(
!
pp_osver
)
{
win_skip
(
"_osver variables are not available
\n
"
);
return
;
}
osver
=
*
pp_osver
();
ok
(
osver
==
(
osvi
.
dwBuildNumber
&
0xffff
)
||
((
osvi
.
dwBuildNumber
>>
24
)
==
osvi
.
dwMajorVersion
&&
((
osvi
.
dwBuildNumber
>>
16
)
&
0xff
)
==
osvi
.
dwMinorVersion
),
/* 95/98/ME */
"Wrong value for _osver %04x expected %04x
\n
"
,
osver
,
osvi
.
dwBuildNumber
);
}
START_TEST
(
data
)
{
HMODULE
hmsvcrt
;
hmsvcrt
=
GetModuleHandleA
(
"msvcrt.dll"
);
if
(
!
hmsvcrt
)
hmsvcrt
=
GetModuleHandleA
(
"msvcrtd.dll"
);
if
(
hmsvcrt
)
p_initterm
=
(
void
*
)
GetProcAddress
(
hmsvcrt
,
"_initterm"
);
test_initterm
();
test_initvar
(
hmsvcrt
);
}
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