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
d8582d97
Commit
d8582d97
authored
Aug 09, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Move process/thread attribute list functions to kernelbase.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
09f588ee
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
147 additions
and
143 deletions
+147
-143
kernel32.spec
dlls/kernel32/kernel32.spec
+3
-3
process.c
dlls/kernel32/process.c
+0
-137
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+3
-3
process.c
dlls/kernelbase/process.c
+141
-0
No files found.
dlls/kernel32/kernel32.spec
View file @
d8582d97
...
...
@@ -365,7 +365,7 @@
# @ stub DeleteFileTransactedA
# @ stub DeleteFileTransactedW
@ stdcall DeleteFileW(wstr)
@ stdcall DeleteProcThreadAttributeList(ptr)
@ stdcall
-import
DeleteProcThreadAttributeList(ptr)
# @ stub DisableThreadProfiling
@ stdcall DisassociateCurrentThreadFromCallback(ptr) ntdll.TpDisassociateCallback
@ stdcall DeleteTimerQueue(long)
...
...
@@ -949,7 +949,7 @@
@ stdcall InitializeCriticalSection(ptr) ntdll.RtlInitializeCriticalSection
@ stdcall -import InitializeCriticalSectionAndSpinCount(ptr long)
@ stdcall -import InitializeCriticalSectionEx(ptr long long)
@ stdcall InitializeProcThreadAttributeList(ptr long long ptr)
@ stdcall
-import
InitializeProcThreadAttributeList(ptr long long ptr)
@ stdcall InitializeSListHead(ptr) ntdll.RtlInitializeSListHead
@ stdcall InitializeSRWLock(ptr) ntdll.RtlInitializeSRWLock
@ stdcall -arch=i386 InterlockedCompareExchange (ptr long long)
...
...
@@ -1543,7 +1543,7 @@
@ stdcall UnregisterWait(long)
@ stdcall -import UnregisterWaitEx(long long)
# @ stub UpdateCalendarDayOfWeek
@ stdcall UpdateProcThreadAttribute(ptr long long ptr long ptr ptr)
@ stdcall
-import
UpdateProcThreadAttribute(ptr long long ptr long ptr ptr)
@ stdcall UpdateResourceA(long str str long ptr long)
@ stdcall UpdateResourceW(long wstr wstr long ptr long)
@ stub VDMConsoleOperation
...
...
dlls/kernel32/process.c
View file @
d8582d97
...
...
@@ -4113,135 +4113,6 @@ HRESULT WINAPI UnregisterApplicationRestart(void)
return
S_OK
;
}
struct
proc_thread_attr
{
DWORD_PTR
attr
;
SIZE_T
size
;
void
*
value
;
};
struct
_PROC_THREAD_ATTRIBUTE_LIST
{
DWORD
mask
;
/* bitmask of items in list */
DWORD
size
;
/* max number of items in list */
DWORD
count
;
/* number of items in list */
DWORD
pad
;
DWORD_PTR
unk
;
struct
proc_thread_attr
attrs
[
1
];
};
/***********************************************************************
* InitializeProcThreadAttributeList (KERNEL32.@)
*/
BOOL
WINAPI
InitializeProcThreadAttributeList
(
struct
_PROC_THREAD_ATTRIBUTE_LIST
*
list
,
DWORD
count
,
DWORD
flags
,
SIZE_T
*
size
)
{
SIZE_T
needed
;
BOOL
ret
=
FALSE
;
TRACE
(
"(%p %d %x %p)
\n
"
,
list
,
count
,
flags
,
size
);
needed
=
FIELD_OFFSET
(
struct
_PROC_THREAD_ATTRIBUTE_LIST
,
attrs
[
count
]);
if
(
list
&&
*
size
>=
needed
)
{
list
->
mask
=
0
;
list
->
size
=
count
;
list
->
count
=
0
;
list
->
unk
=
0
;
ret
=
TRUE
;
}
else
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
*
size
=
needed
;
return
ret
;
}
/***********************************************************************
* UpdateProcThreadAttribute (KERNEL32.@)
*/
BOOL
WINAPI
UpdateProcThreadAttribute
(
struct
_PROC_THREAD_ATTRIBUTE_LIST
*
list
,
DWORD
flags
,
DWORD_PTR
attr
,
void
*
value
,
SIZE_T
size
,
void
*
prev_ret
,
SIZE_T
*
size_ret
)
{
DWORD
mask
;
struct
proc_thread_attr
*
entry
;
TRACE
(
"(%p %x %08lx %p %ld %p %p)
\n
"
,
list
,
flags
,
attr
,
value
,
size
,
prev_ret
,
size_ret
);
if
(
list
->
count
>=
list
->
size
)
{
SetLastError
(
ERROR_GEN_FAILURE
);
return
FALSE
;
}
switch
(
attr
)
{
case
PROC_THREAD_ATTRIBUTE_PARENT_PROCESS
:
if
(
size
!=
sizeof
(
HANDLE
))
{
SetLastError
(
ERROR_BAD_LENGTH
);
return
FALSE
;
}
break
;
case
PROC_THREAD_ATTRIBUTE_HANDLE_LIST
:
if
((
size
/
sizeof
(
HANDLE
))
*
sizeof
(
HANDLE
)
!=
size
)
{
SetLastError
(
ERROR_BAD_LENGTH
);
return
FALSE
;
}
break
;
case
PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR
:
if
(
size
!=
sizeof
(
PROCESSOR_NUMBER
))
{
SetLastError
(
ERROR_BAD_LENGTH
);
return
FALSE
;
}
break
;
case
PROC_THREAD_ATTRIBUTE_CHILD_PROCESS_POLICY
:
if
(
size
!=
sizeof
(
DWORD
)
&&
size
!=
sizeof
(
DWORD64
))
{
SetLastError
(
ERROR_BAD_LENGTH
);
return
FALSE
;
}
break
;
case
PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY
:
if
(
size
!=
sizeof
(
DWORD
)
&&
size
!=
sizeof
(
DWORD64
)
&&
size
!=
sizeof
(
DWORD64
)
*
2
)
{
SetLastError
(
ERROR_BAD_LENGTH
);
return
FALSE
;
}
break
;
default:
SetLastError
(
ERROR_NOT_SUPPORTED
);
FIXME
(
"Unhandled attribute number %lu
\n
"
,
attr
&
PROC_THREAD_ATTRIBUTE_NUMBER
);
return
FALSE
;
}
mask
=
1
<<
(
attr
&
PROC_THREAD_ATTRIBUTE_NUMBER
);
if
(
list
->
mask
&
mask
)
{
SetLastError
(
ERROR_OBJECT_NAME_EXISTS
);
return
FALSE
;
}
list
->
mask
|=
mask
;
entry
=
list
->
attrs
+
list
->
count
;
entry
->
attr
=
attr
;
entry
->
size
=
size
;
entry
->
value
=
value
;
list
->
count
++
;
return
TRUE
;
}
/***********************************************************************
* CreateUmsCompletionList (KERNEL32.@)
*/
...
...
@@ -4263,14 +4134,6 @@ BOOL WINAPI CreateUmsThreadContext(PUMS_CONTEXT *ctx)
}
/***********************************************************************
* DeleteProcThreadAttributeList (KERNEL32.@)
*/
void
WINAPI
DeleteProcThreadAttributeList
(
struct
_PROC_THREAD_ATTRIBUTE_LIST
*
list
)
{
return
;
}
/***********************************************************************
* DeleteUmsCompletionList (KERNEL32.@)
*/
BOOL
WINAPI
DeleteUmsCompletionList
(
PUMS_COMPLETION_LIST
list
)
...
...
dlls/kernelbase/kernelbase.spec
View file @
d8582d97
...
...
@@ -252,7 +252,7 @@
@ stdcall DeleteFiber(ptr)
@ stdcall DeleteFileA(str) kernel32.DeleteFileA
@ stdcall DeleteFileW(wstr) kernel32.DeleteFileW
@ stdcall DeleteProcThreadAttributeList(ptr)
kernel32.DeleteProcThreadAttributeList
@ stdcall DeleteProcThreadAttributeList(ptr)
# @ stub DeleteStateAtomValue
# @ stub DeleteStateContainer
# @ stub DeleteStateContainerValue
...
...
@@ -805,7 +805,7 @@
@ stdcall InitializeCriticalSectionAndSpinCount(ptr long)
@ stdcall InitializeCriticalSectionEx(ptr long long)
# @ stub InitializeEnclave
@ stdcall InitializeProcThreadAttributeList(ptr long long ptr)
kernel32.InitializeProcThreadAttributeList
@ stdcall InitializeProcThreadAttributeList(ptr long long ptr)
# @ stub InitializeProcessForWsWatch
@ stdcall InitializeSListHead(ptr) ntdll.RtlInitializeSListHead
@ stdcall InitializeSRWLock(ptr) ntdll.RtlInitializeSRWLock
...
...
@@ -1627,7 +1627,7 @@
# @ stub UnsubscribeStateChangeNotification
# @ stub UpdatePackageStatus
# @ stub UpdatePackageStatusForUser
@ stdcall UpdateProcThreadAttribute(ptr long long ptr long ptr ptr)
kernel32.UpdateProcThreadAttribute
@ stdcall UpdateProcThreadAttribute(ptr long long ptr long ptr ptr)
@ stdcall UrlApplySchemeA(str ptr ptr long)
@ stdcall UrlApplySchemeW(wstr ptr ptr long)
@ stdcall UrlCanonicalizeA(str ptr ptr long)
...
...
dlls/kernelbase/process.c
View file @
d8582d97
...
...
@@ -344,3 +344,144 @@ BOOL WINAPI DECLSPEC_HOTPATCH TerminateProcess( HANDLE handle, DWORD exit_code )
}
return
set_ntstatus
(
NtTerminateProcess
(
handle
,
exit_code
));
}
/***********************************************************************
* Process/thread attribute lists
***********************************************************************/
struct
proc_thread_attr
{
DWORD_PTR
attr
;
SIZE_T
size
;
void
*
value
;
};
struct
_PROC_THREAD_ATTRIBUTE_LIST
{
DWORD
mask
;
/* bitmask of items in list */
DWORD
size
;
/* max number of items in list */
DWORD
count
;
/* number of items in list */
DWORD
pad
;
DWORD_PTR
unk
;
struct
proc_thread_attr
attrs
[
1
];
};
/***********************************************************************
* InitializeProcThreadAttributeList (kernelbase.@)
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
InitializeProcThreadAttributeList
(
struct
_PROC_THREAD_ATTRIBUTE_LIST
*
list
,
DWORD
count
,
DWORD
flags
,
SIZE_T
*
size
)
{
SIZE_T
needed
;
BOOL
ret
=
FALSE
;
TRACE
(
"(%p %d %x %p)
\n
"
,
list
,
count
,
flags
,
size
);
needed
=
FIELD_OFFSET
(
struct
_PROC_THREAD_ATTRIBUTE_LIST
,
attrs
[
count
]
);
if
(
list
&&
*
size
>=
needed
)
{
list
->
mask
=
0
;
list
->
size
=
count
;
list
->
count
=
0
;
list
->
unk
=
0
;
ret
=
TRUE
;
}
else
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
*
size
=
needed
;
return
ret
;
}
/***********************************************************************
* UpdateProcThreadAttribute (kernelbase.@)
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
UpdateProcThreadAttribute
(
struct
_PROC_THREAD_ATTRIBUTE_LIST
*
list
,
DWORD
flags
,
DWORD_PTR
attr
,
void
*
value
,
SIZE_T
size
,
void
*
prev_ret
,
SIZE_T
*
size_ret
)
{
DWORD
mask
;
struct
proc_thread_attr
*
entry
;
TRACE
(
"(%p %x %08lx %p %ld %p %p)
\n
"
,
list
,
flags
,
attr
,
value
,
size
,
prev_ret
,
size_ret
);
if
(
list
->
count
>=
list
->
size
)
{
SetLastError
(
ERROR_GEN_FAILURE
);
return
FALSE
;
}
switch
(
attr
)
{
case
PROC_THREAD_ATTRIBUTE_PARENT_PROCESS
:
if
(
size
!=
sizeof
(
HANDLE
))
{
SetLastError
(
ERROR_BAD_LENGTH
);
return
FALSE
;
}
break
;
case
PROC_THREAD_ATTRIBUTE_HANDLE_LIST
:
if
((
size
/
sizeof
(
HANDLE
))
*
sizeof
(
HANDLE
)
!=
size
)
{
SetLastError
(
ERROR_BAD_LENGTH
);
return
FALSE
;
}
break
;
case
PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR
:
if
(
size
!=
sizeof
(
PROCESSOR_NUMBER
))
{
SetLastError
(
ERROR_BAD_LENGTH
);
return
FALSE
;
}
break
;
case
PROC_THREAD_ATTRIBUTE_CHILD_PROCESS_POLICY
:
if
(
size
!=
sizeof
(
DWORD
)
&&
size
!=
sizeof
(
DWORD64
))
{
SetLastError
(
ERROR_BAD_LENGTH
);
return
FALSE
;
}
break
;
case
PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY
:
if
(
size
!=
sizeof
(
DWORD
)
&&
size
!=
sizeof
(
DWORD64
)
&&
size
!=
sizeof
(
DWORD64
)
*
2
)
{
SetLastError
(
ERROR_BAD_LENGTH
);
return
FALSE
;
}
break
;
default:
SetLastError
(
ERROR_NOT_SUPPORTED
);
FIXME
(
"Unhandled attribute %lu
\n
"
,
attr
&
PROC_THREAD_ATTRIBUTE_NUMBER
);
return
FALSE
;
}
mask
=
1
<<
(
attr
&
PROC_THREAD_ATTRIBUTE_NUMBER
);
if
(
list
->
mask
&
mask
)
{
SetLastError
(
ERROR_OBJECT_NAME_EXISTS
);
return
FALSE
;
}
list
->
mask
|=
mask
;
entry
=
list
->
attrs
+
list
->
count
;
entry
->
attr
=
attr
;
entry
->
size
=
size
;
entry
->
value
=
value
;
list
->
count
++
;
return
TRUE
;
}
/***********************************************************************
* DeleteProcThreadAttributeList (kernelbase.@)
*/
void
WINAPI
DECLSPEC_HOTPATCH
DeleteProcThreadAttributeList
(
struct
_PROC_THREAD_ATTRIBUTE_LIST
*
list
)
{
return
;
}
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