mirror of
https://github.com/decompals/wibo.git
synced 2025-12-12 06:45:05 +00:00
Split advapi32 into separate files (part 2) & more impls for ee-gcc/cygwin
This commit is contained in:
27
dll/advapi32/processthreadsapi.cpp
Normal file
27
dll/advapi32/processthreadsapi.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "processthreadsapi.h"
|
||||
|
||||
#include "errors.h"
|
||||
#include "handles.h"
|
||||
#include "internal.h"
|
||||
|
||||
namespace advapi32 {
|
||||
|
||||
BOOL WIN_FUNC OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle) {
|
||||
DEBUG_LOG("OpenProcessToken(%p, %u, %p)\n", ProcessHandle, DesiredAccess, TokenHandle);
|
||||
if (!TokenHandle) {
|
||||
wibo::lastError = ERROR_INVALID_PARAMETER;
|
||||
return FALSE;
|
||||
}
|
||||
auto *token = new TokenObject;
|
||||
token->processHandle = ProcessHandle;
|
||||
token->desiredAccess = DesiredAccess;
|
||||
handles::Data data;
|
||||
data.type = handles::TYPE_TOKEN;
|
||||
data.ptr = token;
|
||||
data.size = sizeof(TokenObject);
|
||||
*TokenHandle = handles::allocDataHandle(data);
|
||||
wibo::lastError = ERROR_SUCCESS;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
} // namespace advapi32
|
||||
Reference in New Issue
Block a user