Author: jgardou
Date: Sun Oct 5 14:19:53 2014
New Revision: 64544
URL:
http://svn.reactos.org/svn/reactos?rev=64544&view=rev
Log:
[ADVAPI32]
- Add a few debug prints.
Modified:
trunk/reactos/dll/win32/advapi32/misc/logon.c
trunk/reactos/dll/win32/advapi32/sec/misc.c
trunk/reactos/dll/win32/advapi32/token/token.c
Modified: trunk/reactos/dll/win32/advapi32/misc/logon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/lo…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] Sun Oct 5 14:19:53 2014
@@ -105,6 +105,10 @@
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 @@
lpStartupInfo,
lpProcessInformation))
{
+ ERR("CreateProcessA failed! GLE: %d\n", GetLastError());
return FALSE;
}
@@ -130,6 +135,7 @@
sizeof(AccessToken));
if (!NT_SUCCESS (Status))
{
+ ERR("NtSetInformationProcess failed: 0x%08x\n", Status);
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@@ -137,6 +143,7 @@
/* Resume the main thread */
if (!(dwCreationFlags & CREATE_SUSPENDED))
{
+ ERR("Resuming thread!\n");
ResumeThread(lpProcessInformation->hThread);
}
@@ -163,6 +170,10 @@
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 @@
lpStartupInfo,
lpProcessInformation))
{
+ ERR("CreateProcessW failed! GLE: %d\n", GetLastError());
return FALSE;
}
@@ -188,6 +200,7 @@
sizeof(AccessToken));
if (!NT_SUCCESS (Status))
{
+ ERR("NtSetInformationProcess failed: 0x%08x\n", Status);
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@@ -195,6 +208,7 @@
/* Resume the main thread */
if (!(dwCreationFlags & CREATE_SUSPENDED))
{
+ ERR("Resuming thread!\n");
ResumeThread(lpProcessInformation->hThread);
}
Modified: trunk/reactos/dll/win32/advapi32/sec/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/mis…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/misc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/sec/misc.c [iso-8859-1] Sun Oct 5 14:19:53 2014
@@ -526,6 +526,7 @@
&NewToken);
if (!NT_SUCCESS(Status))
{
+ ERR("NtDuplicateToken failed: Status %08x\n", Status);
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@@ -552,6 +553,7 @@
if (!NT_SUCCESS(Status))
{
+ ERR("NtSetInformationThread failed: Status %08x\n", Status);
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
Modified: trunk/reactos/dll/win32/advapi32/token/token.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/token/t…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/token/token.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/token/token.c [iso-8859-1] Sun Oct 5 14:19:53 2014
@@ -218,14 +218,19 @@
{
NTSTATUS Status;
+ TRACE("%p, %x, %p.\n", ProcessHandle, DesiredAccess, TokenHandle);
+
Status = NtOpenProcessToken(ProcessHandle,
DesiredAccess,
TokenHandle);
if (!NT_SUCCESS(Status))
{
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
+ ERR("NtOpenProcessToken failed! Status %08x.\n", Status);
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ TRACE("Returning token %p.\n", *TokenHandle);
return TRUE;
}
@@ -297,6 +302,9 @@
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,9 +337,12 @@
DuplicateTokenHandle);
if (!NT_SUCCESS(Status))
{
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
+ ERR("NtDuplicateToken failed: Status %08x\n", Status);
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ TRACE("Returning token %p.\n", *DuplicateTokenHandle);
return TRUE;
}