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
eac5395f
Commit
eac5395f
authored
Sep 26, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Move some misc functions to kernelbase.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ea43b87c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
98 additions
and
122 deletions
+98
-122
cpu.c
dlls/kernel32/cpu.c
+0
-10
kernel32.spec
dlls/kernel32/kernel32.spec
+4
-4
sync.c
dlls/kernel32/sync.c
+0
-89
version.c
dlls/kernel32/version.c
+0
-15
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+4
-4
process.c
dlls/kernelbase/process.c
+30
-0
sync.c
dlls/kernelbase/sync.c
+50
-0
version.c
dlls/kernelbase/version.c
+10
-0
No files found.
dlls/kernel32/cpu.c
View file @
eac5395f
...
...
@@ -150,16 +150,6 @@ VOID WINAPI GetNativeSystemInfo(
}
/***********************************************************************
* IsProcessorFeaturePresent [KERNEL32.@]
*
* Determine if the cpu supports a given feature.
*/
BOOL
WINAPI
IsProcessorFeaturePresent
(
DWORD
feature
)
{
return
RtlIsProcessorFeaturePresent
(
feature
);
}
/***********************************************************************
* K32GetPerformanceInfo (KERNEL32.@)
*/
BOOL
WINAPI
K32GetPerformanceInfo
(
PPERFORMANCE_INFORMATION
info
,
DWORD
size
)
...
...
dlls/kernel32/kernel32.spec
View file @
eac5395f
...
...
@@ -306,7 +306,7 @@
@ stdcall CreateNamedPipeA(str long long long long long long ptr)
@ stdcall -import CreateNamedPipeW(wstr long long long long long long ptr)
# @ stub CreateNlsSecurityDescriptor
@ stdcall CreatePipe(ptr ptr ptr long)
@ stdcall
-import
CreatePipe(ptr ptr ptr long)
# @ stub CreatePrivateNamespaceA
# @ stub CreatePrivateNamespaceW
@ stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr)
...
...
@@ -795,7 +795,7 @@
@ stdcall GetProcessVersion(long)
@ stdcall GetProcessWorkingSetSize(long ptr ptr)
@ stdcall -import GetProcessWorkingSetSizeEx(long ptr ptr ptr)
@ stdcall GetProductInfo(long long long long ptr)
@ stdcall
-import
GetProductInfo(long long long long ptr)
@ stub GetProductName
@ stdcall GetProfileIntA(str str long)
@ stdcall GetProfileIntW(wstr wstr long)
...
...
@@ -981,8 +981,8 @@
@ stub -i386 IsLSCallback
# @ stub IsNLSDefinedString
@ stdcall IsNormalizedString(long wstr long)
@ stdcall IsProcessInJob(long long ptr)
@ stdcall IsProcessorFeaturePresent(long)
@ stdcall
-import
IsProcessInJob(long long ptr)
@ stdcall
-import
IsProcessorFeaturePresent(long)
@ stub -i386 IsSLCallback
@ stdcall IsSystemResumeAutomatic()
@ stdcall -import IsThreadAFiber()
...
...
dlls/kernel32/sync.c
View file @
eac5395f
...
...
@@ -382,26 +382,6 @@ BOOL WINAPI AssignProcessToJobObject( HANDLE job, HANDLE process )
return
!
status
;
}
/******************************************************************************
* IsProcessInJob (KERNEL32.@)
*/
BOOL
WINAPI
IsProcessInJob
(
HANDLE
process
,
HANDLE
job
,
PBOOL
result
)
{
NTSTATUS
status
=
NtIsProcessInJob
(
process
,
job
);
switch
(
status
)
{
case
STATUS_PROCESS_IN_JOB
:
*
result
=
TRUE
;
return
TRUE
;
case
STATUS_PROCESS_NOT_IN_JOB
:
*
result
=
FALSE
;
return
TRUE
;
default:
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
FALSE
;
}
}
/*
* Timers
...
...
@@ -739,75 +719,6 @@ BOOL WINAPI CallNamedPipeA(
return
ret
;
}
/******************************************************************
* CreatePipe (KERNEL32.@)
*
*/
BOOL
WINAPI
CreatePipe
(
PHANDLE
hReadPipe
,
PHANDLE
hWritePipe
,
LPSECURITY_ATTRIBUTES
sa
,
DWORD
size
)
{
static
unsigned
index
/* = 0 */
;
WCHAR
name
[
64
];
HANDLE
hr
,
hw
;
unsigned
in_index
=
index
;
UNICODE_STRING
nt_name
;
OBJECT_ATTRIBUTES
attr
;
NTSTATUS
status
;
IO_STATUS_BLOCK
iosb
;
LARGE_INTEGER
timeout
;
*
hReadPipe
=
*
hWritePipe
=
INVALID_HANDLE_VALUE
;
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
ObjectName
=
&
nt_name
;
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
|
((
sa
&&
sa
->
bInheritHandle
)
?
OBJ_INHERIT
:
0
);
attr
.
SecurityDescriptor
=
sa
?
sa
->
lpSecurityDescriptor
:
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
if
(
!
size
)
size
=
4096
;
timeout
.
QuadPart
=
(
ULONGLONG
)
NMPWAIT_USE_DEFAULT_WAIT
*
-
10000
;
/* generate a unique pipe name (system wide) */
do
{
static
const
WCHAR
nameFmt
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'p'
,
'i'
,
'p'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'3'
,
'2'
,
'.'
,
'P'
,
'i'
,
'p'
,
'e'
,
's'
,
'.'
,
'%'
,
'0'
,
'8'
,
'l'
,
'u'
,
'.'
,
'%'
,
'0'
,
'8'
,
'u'
,
'\0'
};
snprintfW
(
name
,
ARRAY_SIZE
(
name
),
nameFmt
,
GetCurrentProcessId
(),
++
index
);
RtlInitUnicodeString
(
&
nt_name
,
name
);
status
=
NtCreateNamedPipeFile
(
&
hr
,
GENERIC_READ
|
FILE_WRITE_ATTRIBUTES
|
SYNCHRONIZE
,
&
attr
,
&
iosb
,
FILE_SHARE_WRITE
,
FILE_OVERWRITE_IF
,
FILE_SYNCHRONOUS_IO_NONALERT
,
FALSE
,
FALSE
,
FALSE
,
1
,
size
,
size
,
&
timeout
);
if
(
status
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
hr
=
INVALID_HANDLE_VALUE
;
}
}
while
(
hr
==
INVALID_HANDLE_VALUE
&&
index
!=
in_index
);
/* from completion sakeness, I think system resources might be exhausted before this happens !! */
if
(
hr
==
INVALID_HANDLE_VALUE
)
return
FALSE
;
status
=
NtOpenFile
(
&
hw
,
GENERIC_WRITE
|
FILE_READ_ATTRIBUTES
|
SYNCHRONIZE
,
&
attr
,
&
iosb
,
0
,
FILE_SYNCHRONOUS_IO_NONALERT
|
FILE_NON_DIRECTORY_FILE
);
if
(
status
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
NtClose
(
hr
);
return
FALSE
;
}
*
hReadPipe
=
hr
;
*
hWritePipe
=
hw
;
return
TRUE
;
}
/******************************************************************************
* CreateMailslotA [KERNEL32.@]
*
...
...
dlls/kernel32/version.c
View file @
eac5395f
...
...
@@ -111,21 +111,6 @@ DWORD WINAPI SetTermsrvAppInstallMode(BOOL bInstallMode)
}
/***********************************************************************
* GetProductInfo (KERNEL32.@)
*
* Gives info about the current Windows product type, in a format compatible
* with the given Windows version
*
* Returns TRUE if the input is valid, FALSE otherwise
*/
BOOL
WINAPI
GetProductInfo
(
DWORD
dwOSMajorVersion
,
DWORD
dwOSMinorVersion
,
DWORD
dwSpMajorVersion
,
DWORD
dwSpMinorVersion
,
PDWORD
pdwReturnedProductType
)
{
return
RtlGetProductInfo
(
dwOSMajorVersion
,
dwOSMinorVersion
,
dwSpMajorVersion
,
dwSpMinorVersion
,
pdwReturnedProductType
);
}
/***********************************************************************
* GetCurrentPackageId (KERNEL32.@)
*/
LONG
WINAPI
GetCurrentPackageId
(
UINT32
*
len
,
BYTE
*
buffer
)
...
...
dlls/kernelbase/kernelbase.spec
View file @
eac5395f
...
...
@@ -200,7 +200,7 @@
@ stdcall CreateMutexExW(ptr wstr long long)
@ stdcall CreateMutexW(ptr long wstr)
@ stdcall CreateNamedPipeW(wstr long long long long long long ptr)
@ stdcall CreatePipe(ptr ptr ptr long)
kernel32.CreatePipe
@ stdcall CreatePipe(ptr ptr ptr long)
# @ stub CreatePrivateNamespaceW
@ stdcall CreatePrivateObjectSecurity(ptr ptr ptr long long ptr)
@ stdcall CreatePrivateObjectSecurityEx(ptr ptr ptr ptr long long long ptr)
...
...
@@ -639,7 +639,7 @@
@ stdcall GetProcessVersion(long) kernel32.GetProcessVersion
@ stdcall GetProcessWorkingSetSizeEx(long ptr ptr ptr)
# @ stub GetProcessorSystemCycleTime
@ stdcall GetProductInfo(long long long long ptr)
kernel32.GetProductInfo
@ stdcall GetProductInfo(long long long long ptr)
@ stub GetPtrCalData
@ stub GetPtrCalDataArray
# @ stub GetPublisherCacheFolder
...
...
@@ -864,8 +864,8 @@
@ stub IsNLSDefinedString
@ stdcall IsNormalizedString(long wstr long) kernel32.IsNormalizedString
# @ stub IsProcessCritical
@ stdcall IsProcessInJob(long long ptr)
kernel32.IsProcessInJob
@ stdcall IsProcessorFeaturePresent(long)
kernel32.IsProcessorFeaturePresent
@ stdcall IsProcessInJob(long long ptr)
@ stdcall IsProcessorFeaturePresent(long)
# @ stub IsSideloadingEnabled
# @ stub IsSideloadingPolicyApplied
# @ stub IsSyncForegroundPolicyRefresh
...
...
dlls/kernelbase/process.c
View file @
eac5395f
...
...
@@ -259,6 +259,36 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetProcessWorkingSetSizeEx( HANDLE process, SIZE_T
}
/******************************************************************************
* IsProcessInJob (kernelbase.@)
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
IsProcessInJob
(
HANDLE
process
,
HANDLE
job
,
BOOL
*
result
)
{
NTSTATUS
status
=
NtIsProcessInJob
(
process
,
job
);
switch
(
status
)
{
case
STATUS_PROCESS_IN_JOB
:
*
result
=
TRUE
;
return
TRUE
;
case
STATUS_PROCESS_NOT_IN_JOB
:
*
result
=
FALSE
;
return
TRUE
;
default
:
return
set_ntstatus
(
status
);
}
}
/***********************************************************************
* IsProcessorFeaturePresent (kernelbase.@)
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
IsProcessorFeaturePresent
(
DWORD
feature
)
{
return
RtlIsProcessorFeaturePresent
(
feature
);
}
/**********************************************************************
* IsWow64Process (kernelbase.@)
*/
...
...
dlls/kernelbase/sync.c
View file @
eac5395f
...
...
@@ -1172,6 +1172,56 @@ HANDLE WINAPI DECLSPEC_HOTPATCH CreateNamedPipeW( LPCWSTR name, DWORD open_mode,
}
/******************************************************************
* CreatePipe (kernelbase.@)
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
CreatePipe
(
HANDLE
*
read_pipe
,
HANDLE
*
write_pipe
,
SECURITY_ATTRIBUTES
*
sa
,
DWORD
size
)
{
static
unsigned
int
index
;
WCHAR
name
[
64
];
UNICODE_STRING
nt_name
;
OBJECT_ATTRIBUTES
attr
;
IO_STATUS_BLOCK
iosb
;
LARGE_INTEGER
timeout
;
*
read_pipe
=
*
write_pipe
=
INVALID_HANDLE_VALUE
;
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
ObjectName
=
&
nt_name
;
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
|
((
sa
&&
sa
->
bInheritHandle
)
?
OBJ_INHERIT
:
0
);
attr
.
SecurityDescriptor
=
sa
?
sa
->
lpSecurityDescriptor
:
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
if
(
!
size
)
size
=
4096
;
timeout
.
QuadPart
=
(
ULONGLONG
)
NMPWAIT_USE_DEFAULT_WAIT
*
-
10000
;
/* generate a unique pipe name (system wide) */
for
(;;)
{
static
const
WCHAR
fmtW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'p'
,
'i'
,
'p'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'3'
,
'2'
,
'.'
,
'P'
,
'i'
,
'p'
,
'e'
,
's'
,
'.'
,
'%'
,
'0'
,
'8'
,
'l'
,
'u'
,
'.'
,
'%'
,
'0'
,
'8'
,
'u'
,
'\0'
};
swprintf
(
name
,
ARRAY_SIZE
(
name
),
fmtW
,
GetCurrentProcessId
(),
++
index
);
RtlInitUnicodeString
(
&
nt_name
,
name
);
if
(
!
NtCreateNamedPipeFile
(
read_pipe
,
GENERIC_READ
|
FILE_WRITE_ATTRIBUTES
|
SYNCHRONIZE
,
&
attr
,
&
iosb
,
FILE_SHARE_WRITE
,
FILE_OVERWRITE_IF
,
FILE_SYNCHRONOUS_IO_NONALERT
,
FALSE
,
FALSE
,
FALSE
,
1
,
size
,
size
,
&
timeout
))
break
;
}
if
(
!
set_ntstatus
(
NtOpenFile
(
write_pipe
,
GENERIC_WRITE
|
FILE_READ_ATTRIBUTES
|
SYNCHRONIZE
,
&
attr
,
&
iosb
,
0
,
FILE_SYNCHRONOUS_IO_NONALERT
|
FILE_NON_DIRECTORY_FILE
)))
{
NtClose
(
*
read_pipe
);
return
FALSE
;
}
return
TRUE
;
}
/***********************************************************************
* DisconnectNamedPipe (kernelbase.@)
*/
...
...
dlls/kernelbase/version.c
View file @
eac5395f
...
...
@@ -1340,6 +1340,16 @@ DWORD WINAPI VerFindFileW( DWORD flags, LPCWSTR filename, LPCWSTR win_dir, LPCWS
/***********************************************************************
* GetProductInfo (kernelbase.@)
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
GetProductInfo
(
DWORD
os_major
,
DWORD
os_minor
,
DWORD
sp_major
,
DWORD
sp_minor
,
DWORD
*
type
)
{
return
RtlGetProductInfo
(
os_major
,
os_minor
,
sp_major
,
sp_minor
,
type
);
}
/***********************************************************************
* GetVersion (kernelbase.@)
*/
DWORD
WINAPI
GetVersion
(
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