Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
471c2f56
Commit
471c2f56
authored
Sep 08, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Move OS version functions to kernelbase.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d38a5ba4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
83 deletions
+72
-83
kernel32.spec
dlls/kernel32/kernel32.spec
+3
-3
version.c
dlls/kernel32/version.c
+0
-77
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+3
-3
version.c
dlls/kernelbase/version.c
+66
-0
No files found.
dlls/kernel32/kernel32.spec
View file @
471c2f56
...
...
@@ -875,9 +875,9 @@
@ stdcall GetUserDefaultUILanguage()
@ stdcall GetUserGeoID(long)
@ stub GetVDMCurrentDirectories
@ stdcall GetVersion()
@ stdcall GetVersionExA(ptr)
@ stdcall GetVersionExW(ptr)
@ stdcall
-import
GetVersion()
@ stdcall
-import
GetVersionExA(ptr)
@ stdcall
-import
GetVersionExW(ptr)
@ stdcall GetVolumeInformationA(str ptr long ptr ptr ptr ptr long)
@ stdcall GetVolumeInformationByHandleW(ptr ptr long ptr ptr ptr ptr long)
@ stdcall GetVolumeInformationW(wstr ptr long ptr ptr ptr ptr long)
...
...
dlls/kernel32/version.c
View file @
471c2f56
...
...
@@ -42,83 +42,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
ver
);
/***********************************************************************
* GetVersion (KERNEL32.@)
*
* Win31 0x80000a03
* Win95 0xc0000004
* Win98 0xc0000a04
* WinME 0xc0005a04
* NT351 0x04213303
* NT4 0x05650004
* Win2000 0x08930005
* WinXP 0x0a280105
*/
DWORD
WINAPI
GetVersion
(
void
)
{
DWORD
result
=
MAKELONG
(
MAKEWORD
(
NtCurrentTeb
()
->
Peb
->
OSMajorVersion
,
NtCurrentTeb
()
->
Peb
->
OSMinorVersion
),
(
NtCurrentTeb
()
->
Peb
->
OSPlatformId
^
2
)
<<
14
);
if
(
NtCurrentTeb
()
->
Peb
->
OSPlatformId
==
VER_PLATFORM_WIN32_NT
)
result
|=
LOWORD
(
NtCurrentTeb
()
->
Peb
->
OSBuildNumber
)
<<
16
;
return
result
;
}
/***********************************************************************
* GetVersionExA (KERNEL32.@)
*/
BOOL
WINAPI
GetVersionExA
(
OSVERSIONINFOA
*
v
)
{
RTL_OSVERSIONINFOEXW
infoW
;
if
(
v
->
dwOSVersionInfoSize
!=
sizeof
(
OSVERSIONINFOA
)
&&
v
->
dwOSVersionInfoSize
!=
sizeof
(
OSVERSIONINFOEXA
))
{
WARN
(
"wrong OSVERSIONINFO size from app (got: %d)
\n
"
,
v
->
dwOSVersionInfoSize
);
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
}
infoW
.
dwOSVersionInfoSize
=
sizeof
(
infoW
);
if
(
RtlGetVersion
(
&
infoW
)
!=
STATUS_SUCCESS
)
return
FALSE
;
v
->
dwMajorVersion
=
infoW
.
dwMajorVersion
;
v
->
dwMinorVersion
=
infoW
.
dwMinorVersion
;
v
->
dwBuildNumber
=
infoW
.
dwBuildNumber
;
v
->
dwPlatformId
=
infoW
.
dwPlatformId
;
WideCharToMultiByte
(
CP_ACP
,
0
,
infoW
.
szCSDVersion
,
-
1
,
v
->
szCSDVersion
,
sizeof
(
v
->
szCSDVersion
),
NULL
,
NULL
);
if
(
v
->
dwOSVersionInfoSize
==
sizeof
(
OSVERSIONINFOEXA
))
{
LPOSVERSIONINFOEXA
vex
=
(
LPOSVERSIONINFOEXA
)
v
;
vex
->
wServicePackMajor
=
infoW
.
wServicePackMajor
;
vex
->
wServicePackMinor
=
infoW
.
wServicePackMinor
;
vex
->
wSuiteMask
=
infoW
.
wSuiteMask
;
vex
->
wProductType
=
infoW
.
wProductType
;
}
return
TRUE
;
}
/***********************************************************************
* GetVersionExW (KERNEL32.@)
*/
BOOL
WINAPI
GetVersionExW
(
OSVERSIONINFOW
*
info
)
{
if
(
info
->
dwOSVersionInfoSize
!=
sizeof
(
OSVERSIONINFOW
)
&&
info
->
dwOSVersionInfoSize
!=
sizeof
(
OSVERSIONINFOEXW
))
{
WARN
(
"wrong OSVERSIONINFO size from app (got: %d)
\n
"
,
info
->
dwOSVersionInfoSize
);
return
FALSE
;
}
return
(
RtlGetVersion
(
(
RTL_OSVERSIONINFOEXW
*
)
info
)
==
STATUS_SUCCESS
);
}
/******************************************************************************
* VerifyVersionInfoA (KERNEL32.@)
*/
...
...
dlls/kernelbase/kernelbase.spec
View file @
471c2f56
...
...
@@ -750,9 +750,9 @@
# @ stub GetUserOverrideString
# @ stub GetUserOverrideWord
@ stdcall GetUserPreferredUILanguages(long ptr ptr ptr) kernel32.GetUserPreferredUILanguages
@ stdcall GetVersion()
kernel32.GetVersion
@ stdcall GetVersionExA(ptr)
kernel32.GetVersionExA
@ stdcall GetVersionExW(ptr)
kernel32.GetVersionExW
@ stdcall GetVersion()
@ stdcall GetVersionExA(ptr)
@ stdcall GetVersionExW(ptr)
@ stdcall GetVolumeInformationA(str ptr long ptr ptr ptr ptr long) kernel32.GetVolumeInformationA
@ stdcall GetVolumeInformationByHandleW(ptr ptr long ptr ptr ptr ptr long) kernel32.GetVolumeInformationByHandleW
@ stdcall GetVolumeInformationW(wstr ptr long ptr ptr ptr ptr long) kernel32.GetVolumeInformationW
...
...
dlls/kernelbase/version.c
View file @
471c2f56
...
...
@@ -1337,3 +1337,69 @@ DWORD WINAPI VerFindFileW( DWORD flags, LPCWSTR filename, LPCWSTR win_dir, LPCWS
debugstr_w
(
cur_dir
),
debugstr_w
(
dest
));
return
retval
;
}
/***********************************************************************
* GetVersion (kernelbase.@)
*/
DWORD
WINAPI
GetVersion
(
void
)
{
DWORD
result
=
MAKELONG
(
MAKEWORD
(
NtCurrentTeb
()
->
Peb
->
OSMajorVersion
,
NtCurrentTeb
()
->
Peb
->
OSMinorVersion
),
(
NtCurrentTeb
()
->
Peb
->
OSPlatformId
^
2
)
<<
14
);
if
(
NtCurrentTeb
()
->
Peb
->
OSPlatformId
==
VER_PLATFORM_WIN32_NT
)
result
|=
LOWORD
(
NtCurrentTeb
()
->
Peb
->
OSBuildNumber
)
<<
16
;
return
result
;
}
/***********************************************************************
* GetVersionExA (kernelbase.@)
*/
BOOL
WINAPI
GetVersionExA
(
OSVERSIONINFOA
*
info
)
{
RTL_OSVERSIONINFOEXW
infoW
;
if
(
info
->
dwOSVersionInfoSize
!=
sizeof
(
OSVERSIONINFOA
)
&&
info
->
dwOSVersionInfoSize
!=
sizeof
(
OSVERSIONINFOEXA
))
{
WARN
(
"wrong OSVERSIONINFO size from app (got: %d)
\n
"
,
info
->
dwOSVersionInfoSize
);
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
}
infoW
.
dwOSVersionInfoSize
=
sizeof
(
infoW
);
if
(
!
set_ntstatus
(
RtlGetVersion
(
&
infoW
)))
return
FALSE
;
info
->
dwMajorVersion
=
infoW
.
dwMajorVersion
;
info
->
dwMinorVersion
=
infoW
.
dwMinorVersion
;
info
->
dwBuildNumber
=
infoW
.
dwBuildNumber
;
info
->
dwPlatformId
=
infoW
.
dwPlatformId
;
WideCharToMultiByte
(
CP_ACP
,
0
,
infoW
.
szCSDVersion
,
-
1
,
info
->
szCSDVersion
,
sizeof
(
info
->
szCSDVersion
),
NULL
,
NULL
);
if
(
info
->
dwOSVersionInfoSize
==
sizeof
(
OSVERSIONINFOEXA
))
{
OSVERSIONINFOEXA
*
vex
=
(
OSVERSIONINFOEXA
*
)
info
;
vex
->
wServicePackMajor
=
infoW
.
wServicePackMajor
;
vex
->
wServicePackMinor
=
infoW
.
wServicePackMinor
;
vex
->
wSuiteMask
=
infoW
.
wSuiteMask
;
vex
->
wProductType
=
infoW
.
wProductType
;
}
return
TRUE
;
}
/***********************************************************************
* GetVersionExW (kernelbase.@)
*/
BOOL
WINAPI
GetVersionExW
(
OSVERSIONINFOW
*
info
)
{
if
(
info
->
dwOSVersionInfoSize
!=
sizeof
(
OSVERSIONINFOW
)
&&
info
->
dwOSVersionInfoSize
!=
sizeof
(
OSVERSIONINFOEXW
))
{
WARN
(
"wrong OSVERSIONINFO size from app (got: %d)
\n
"
,
info
->
dwOSVersionInfoSize
);
return
FALSE
;
}
return
set_ntstatus
(
RtlGetVersion
(
(
RTL_OSVERSIONINFOEXW
*
)
info
));
}
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