mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:56:00 +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;
|
PROCESS_ACCESS_TOKEN AccessToken;
|
||||||
NTSTATUS Status;
|
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 */
|
/* Create the process with a suspended main thread */
|
||||||
if (!CreateProcessA(lpApplicationName,
|
if (!CreateProcessA(lpApplicationName,
|
||||||
lpCommandLine,
|
lpCommandLine,
|
||||||
|
@ -117,6 +121,7 @@ CreateProcessAsUserA(HANDLE hToken,
|
||||||
lpStartupInfo,
|
lpStartupInfo,
|
||||||
lpProcessInformation))
|
lpProcessInformation))
|
||||||
{
|
{
|
||||||
|
ERR("CreateProcessA failed! GLE: %d\n", GetLastError());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,6 +135,7 @@ CreateProcessAsUserA(HANDLE hToken,
|
||||||
sizeof(AccessToken));
|
sizeof(AccessToken));
|
||||||
if (!NT_SUCCESS (Status))
|
if (!NT_SUCCESS (Status))
|
||||||
{
|
{
|
||||||
|
ERR("NtSetInformationProcess failed: 0x%08x\n", Status);
|
||||||
SetLastError(RtlNtStatusToDosError(Status));
|
SetLastError(RtlNtStatusToDosError(Status));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -137,6 +143,7 @@ CreateProcessAsUserA(HANDLE hToken,
|
||||||
/* Resume the main thread */
|
/* Resume the main thread */
|
||||||
if (!(dwCreationFlags & CREATE_SUSPENDED))
|
if (!(dwCreationFlags & CREATE_SUSPENDED))
|
||||||
{
|
{
|
||||||
|
ERR("Resuming thread!\n");
|
||||||
ResumeThread(lpProcessInformation->hThread);
|
ResumeThread(lpProcessInformation->hThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,6 +170,10 @@ CreateProcessAsUserW(HANDLE hToken,
|
||||||
PROCESS_ACCESS_TOKEN AccessToken;
|
PROCESS_ACCESS_TOKEN AccessToken;
|
||||||
NTSTATUS Status;
|
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 */
|
/* Create the process with a suspended main thread */
|
||||||
if (!CreateProcessW(lpApplicationName,
|
if (!CreateProcessW(lpApplicationName,
|
||||||
lpCommandLine,
|
lpCommandLine,
|
||||||
|
@ -175,6 +186,7 @@ CreateProcessAsUserW(HANDLE hToken,
|
||||||
lpStartupInfo,
|
lpStartupInfo,
|
||||||
lpProcessInformation))
|
lpProcessInformation))
|
||||||
{
|
{
|
||||||
|
ERR("CreateProcessW failed! GLE: %d\n", GetLastError());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,6 +200,7 @@ CreateProcessAsUserW(HANDLE hToken,
|
||||||
sizeof(AccessToken));
|
sizeof(AccessToken));
|
||||||
if (!NT_SUCCESS (Status))
|
if (!NT_SUCCESS (Status))
|
||||||
{
|
{
|
||||||
|
ERR("NtSetInformationProcess failed: 0x%08x\n", Status);
|
||||||
SetLastError(RtlNtStatusToDosError(Status));
|
SetLastError(RtlNtStatusToDosError(Status));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -195,6 +208,7 @@ CreateProcessAsUserW(HANDLE hToken,
|
||||||
/* Resume the main thread */
|
/* Resume the main thread */
|
||||||
if (!(dwCreationFlags & CREATE_SUSPENDED))
|
if (!(dwCreationFlags & CREATE_SUSPENDED))
|
||||||
{
|
{
|
||||||
|
ERR("Resuming thread!\n");
|
||||||
ResumeThread(lpProcessInformation->hThread);
|
ResumeThread(lpProcessInformation->hThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -526,6 +526,7 @@ ImpersonateLoggedOnUser(HANDLE hToken)
|
||||||
&NewToken);
|
&NewToken);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
ERR("NtDuplicateToken failed: Status %08x\n", Status);
|
||||||
SetLastError(RtlNtStatusToDosError(Status));
|
SetLastError(RtlNtStatusToDosError(Status));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -552,6 +553,7 @@ ImpersonateLoggedOnUser(HANDLE hToken)
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
ERR("NtSetInformationThread failed: Status %08x\n", Status);
|
||||||
SetLastError(RtlNtStatusToDosError(Status));
|
SetLastError(RtlNtStatusToDosError(Status));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,15 +218,20 @@ OpenProcessToken(HANDLE ProcessHandle,
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
TRACE("%p, %x, %p.\n", ProcessHandle, DesiredAccess, TokenHandle);
|
||||||
|
|
||||||
Status = NtOpenProcessToken(ProcessHandle,
|
Status = NtOpenProcessToken(ProcessHandle,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
TokenHandle);
|
TokenHandle);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
ERR("NtOpenProcessToken failed! Status %08x.\n", Status);
|
||||||
SetLastError(RtlNtStatusToDosError(Status));
|
SetLastError(RtlNtStatusToDosError(Status));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TRACE("Returning token %p.\n", *TokenHandle);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,6 +302,9 @@ DuplicateTokenEx(IN HANDLE ExistingTokenHandle,
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
SECURITY_QUALITY_OF_SERVICE Sqos;
|
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.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
|
||||||
Sqos.ImpersonationLevel = ImpersonationLevel;
|
Sqos.ImpersonationLevel = ImpersonationLevel;
|
||||||
Sqos.ContextTrackingMode = 0;
|
Sqos.ContextTrackingMode = 0;
|
||||||
|
@ -329,10 +337,13 @@ DuplicateTokenEx(IN HANDLE ExistingTokenHandle,
|
||||||
DuplicateTokenHandle);
|
DuplicateTokenHandle);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
ERR("NtDuplicateToken failed: Status %08x\n", Status);
|
||||||
SetLastError(RtlNtStatusToDosError(Status));
|
SetLastError(RtlNtStatusToDosError(Status));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TRACE("Returning token %p.\n", *DuplicateTokenHandle);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue