mirror of
https://github.com/reactos/reactos.git
synced 2025-08-01 18:53:05 +00:00
[ADVAPI32]
- Add a few debug prints. svn path=/trunk/; revision=64544
This commit is contained in:
parent
df8d2aa9d4
commit
75f20f9f0c
3 changed files with 27 additions and 0 deletions
|
@ -105,6 +105,10 @@ CreateProcessAsUserA(HANDLE hToken,
|
|||
PROCESS_ACCESS_TOKEN AccessToken;
|
||||
NTSTATUS Status;
|
||||
|
||||
TRACE("%p %s %s %p %p %d 0x%08x %p %s %p %p\n", hToken, debugstr_a(lpApplicationName),
|
||||
debugstr_a(lpCommandLine), lpProcessAttributes, lpThreadAttributes, bInheritHandles,
|
||||
dwCreationFlags, lpEnvironment, debugstr_a(lpCurrentDirectory), lpStartupInfo, lpProcessInformation);
|
||||
|
||||
/* Create the process with a suspended main thread */
|
||||
if (!CreateProcessA(lpApplicationName,
|
||||
lpCommandLine,
|
||||
|
@ -117,6 +121,7 @@ CreateProcessAsUserA(HANDLE hToken,
|
|||
lpStartupInfo,
|
||||
lpProcessInformation))
|
||||
{
|
||||
ERR("CreateProcessA failed! GLE: %d\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -130,6 +135,7 @@ CreateProcessAsUserA(HANDLE hToken,
|
|||
sizeof(AccessToken));
|
||||
if (!NT_SUCCESS (Status))
|
||||
{
|
||||
ERR("NtSetInformationProcess failed: 0x%08x\n", Status);
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -137,6 +143,7 @@ CreateProcessAsUserA(HANDLE hToken,
|
|||
/* Resume the main thread */
|
||||
if (!(dwCreationFlags & CREATE_SUSPENDED))
|
||||
{
|
||||
ERR("Resuming thread!\n");
|
||||
ResumeThread(lpProcessInformation->hThread);
|
||||
}
|
||||
|
||||
|
@ -163,6 +170,10 @@ CreateProcessAsUserW(HANDLE hToken,
|
|||
PROCESS_ACCESS_TOKEN AccessToken;
|
||||
NTSTATUS Status;
|
||||
|
||||
TRACE("%p %s %s %p %p %d 0x%08x %p %s %p %p\n", hToken, debugstr_w(lpApplicationName),
|
||||
debugstr_w(lpCommandLine), lpProcessAttributes, lpThreadAttributes, bInheritHandles,
|
||||
dwCreationFlags, lpEnvironment, debugstr_w(lpCurrentDirectory), lpStartupInfo, lpProcessInformation);
|
||||
|
||||
/* Create the process with a suspended main thread */
|
||||
if (!CreateProcessW(lpApplicationName,
|
||||
lpCommandLine,
|
||||
|
@ -175,6 +186,7 @@ CreateProcessAsUserW(HANDLE hToken,
|
|||
lpStartupInfo,
|
||||
lpProcessInformation))
|
||||
{
|
||||
ERR("CreateProcessW failed! GLE: %d\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -188,6 +200,7 @@ CreateProcessAsUserW(HANDLE hToken,
|
|||
sizeof(AccessToken));
|
||||
if (!NT_SUCCESS (Status))
|
||||
{
|
||||
ERR("NtSetInformationProcess failed: 0x%08x\n", Status);
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -195,6 +208,7 @@ CreateProcessAsUserW(HANDLE hToken,
|
|||
/* Resume the main thread */
|
||||
if (!(dwCreationFlags & CREATE_SUSPENDED))
|
||||
{
|
||||
ERR("Resuming thread!\n");
|
||||
ResumeThread(lpProcessInformation->hThread);
|
||||
}
|
||||
|
||||
|
|
|
@ -526,6 +526,7 @@ ImpersonateLoggedOnUser(HANDLE hToken)
|
|||
&NewToken);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ERR("NtDuplicateToken failed: Status %08x\n", Status);
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -552,6 +553,7 @@ ImpersonateLoggedOnUser(HANDLE hToken)
|
|||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ERR("NtSetInformationThread failed: Status %08x\n", Status);
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -218,15 +218,20 @@ OpenProcessToken(HANDLE ProcessHandle,
|
|||
{
|
||||
NTSTATUS Status;
|
||||
|
||||
TRACE("%p, %x, %p.\n", ProcessHandle, DesiredAccess, TokenHandle);
|
||||
|
||||
Status = NtOpenProcessToken(ProcessHandle,
|
||||
DesiredAccess,
|
||||
TokenHandle);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ERR("NtOpenProcessToken failed! Status %08x.\n", Status);
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
TRACE("Returning token %p.\n", *TokenHandle);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -297,6 +302,9 @@ DuplicateTokenEx(IN HANDLE ExistingTokenHandle,
|
|||
NTSTATUS Status;
|
||||
SECURITY_QUALITY_OF_SERVICE Sqos;
|
||||
|
||||
TRACE("%p 0x%08x 0x%08x 0x%08x %p\n", ExistingTokenHandle, dwDesiredAccess,
|
||||
ImpersonationLevel, TokenType, DuplicateTokenHandle);
|
||||
|
||||
Sqos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
|
||||
Sqos.ImpersonationLevel = ImpersonationLevel;
|
||||
Sqos.ContextTrackingMode = 0;
|
||||
|
@ -329,10 +337,13 @@ DuplicateTokenEx(IN HANDLE ExistingTokenHandle,
|
|||
DuplicateTokenHandle);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ERR("NtDuplicateToken failed: Status %08x\n", Status);
|
||||
SetLastError(RtlNtStatusToDosError(Status));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
TRACE("Returning token %p.\n", *DuplicateTokenHandle);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue