Author: tfaber
Date: Mon Jun 23 20:30:54 2014
New Revision: 63635
URL:
http://svn.reactos.org/svn/reactos?rev=63635&view=rev
Log:
[NTDLL:LDR]
- Actually use DPFLTR_LDR_ID in debug prints instead of a magic value and a comment
- Use RtlInitEmptyUnicodeString where appropriate
Modified:
trunk/reactos/dll/ntdll/include/ntdll.h
trunk/reactos/dll/ntdll/ldr/ldrapi.c
trunk/reactos/dll/ntdll/ldr/ldrutils.c
Modified: trunk/reactos/dll/ntdll/include/ntdll.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/include/ntdll.h?…
==============================================================================
--- trunk/reactos/dll/ntdll/include/ntdll.h [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/include/ntdll.h [iso-8859-1] Mon Jun 23 20:30:54 2014
@@ -27,11 +27,11 @@
#include <winbase.h>
#include <winreg.h>
#include <winuser.h>
+#include <dpfilter.h>
#define NTOS_MODE_USER
#include <ndk/cmfuncs.h>
#include <ndk/exfuncs.h>
#include <ndk/iofuncs.h>
-#include <ndk/kdtypes.h>
#include <ndk/kefuncs.h>
#include <ndk/ldrfuncs.h>
#include <ndk/mmfuncs.h>
Modified: trunk/reactos/dll/ntdll/ldr/ldrapi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrapi.c?rev…
==============================================================================
--- trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] Mon Jun 23 20:30:54 2014
@@ -322,10 +322,8 @@
PTEB Teb = NtCurrentTeb();
/* Initialize the strings */
+ RtlInitEmptyUnicodeString(&DllString1, StringBuffer, sizeof(StringBuffer));
RtlInitEmptyUnicodeString(&DllString2, NULL, 0);
- DllString1.Buffer = StringBuffer;
- DllString1.Length = 0;
- DllString1.MaximumLength = sizeof(StringBuffer);
/* Check if the SxS Assemblies specify another file */
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
@@ -410,8 +408,7 @@
(Status != STATUS_OBJECT_NAME_NOT_FOUND) &&
(Status != STATUS_DLL_INIT_FAILED))
{
- // 85 == DPFLTR_LDR_ID;
- DbgPrintEx(85,
+ DbgPrintEx(DPFLTR_LDR_ID,
DPFLTR_WARNING_LEVEL,
"LDR: %s - failing because LdrpLoadDll(%wZ) returned status
%x\n",
__FUNCTION__,
@@ -503,8 +500,11 @@
}
/* Nothing found */
- // 85 == DPFLTR_LDR_ID;
- DbgPrintEx(85, DPFLTR_WARNING_LEVEL, "LDR: %s() exiting 0x%08lx\n",
__FUNCTION__, STATUS_NO_MORE_ENTRIES);
+ DbgPrintEx(DPFLTR_LDR_ID,
+ DPFLTR_WARNING_LEVEL,
+ "LDR: %s() exiting 0x%08lx\n",
+ __FUNCTION__,
+ STATUS_NO_MORE_ENTRIES);
return STATUS_NO_MORE_ENTRIES;
}
Modified: trunk/reactos/dll/ntdll/ldr/ldrutils.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrutils.c?r…
==============================================================================
--- trunk/reactos/dll/ntdll/ldr/ldrutils.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/ldr/ldrutils.c [iso-8859-1] Mon Jun 23 20:30:54 2014
@@ -1072,8 +1072,8 @@
if (!NT_SUCCESS(Status) && (Status != STATUS_DLL_NOT_FOUND))
{
/* Failure */
- DbgPrintEx(81, //DPFLTR_LDR_ID,
- 0,
+ DbgPrintEx(DPFLTR_LDR_ID,
+ DPFLTR_ERROR_LEVEL,
"LDR: %s - call to LdrpCheckForKnownDll(\"%ws\",
...) failed with status %x\n",
__FUNCTION__,
DllName,
@@ -1660,8 +1660,8 @@
/* Display debug output if snaps are on */
if (ShowSnaps)
{
- DbgPrintEx(81, //DPFLTR_LDR_ID,
- 0,
+ DbgPrintEx(DPFLTR_LDR_ID,
+ DPFLTR_ERROR_LEVEL,
"LDR: %s - Expanding full name of %wZ\n",
__FUNCTION__,
OriginalName);
@@ -1737,16 +1737,16 @@
/* Check which output to use -- failure or success */
if (NT_SUCCESS(Status))
{
- DbgPrintEx(81, //DPFLTR_LDR_ID,
- 0,
+ DbgPrintEx(DPFLTR_LDR_ID,
+ DPFLTR_ERROR_LEVEL,
"LDR: %s - Expanded to %wZ\n",
__FUNCTION__,
*ExpandedName);
}
else
{
- DbgPrintEx(81, //DPFLTR_LDR_ID,
- 0,
+ DbgPrintEx(DPFLTR_LDR_ID,
+ DPFLTR_ERROR_LEVEL,
"LDR: %s - Failed to expand %wZ; 0x%08x\n",
__FUNCTION__,
OriginalName,
@@ -1784,8 +1784,8 @@
/* Display debug output if snaps are on */
if (ShowSnaps)
{
- DbgPrintEx(81, //DPFLTR_LDR_ID,
- 0,
+ DbgPrintEx(DPFLTR_LDR_ID,
+ DPFLTR_ERROR_LEVEL,
"LDR: %s - Looking for %ws in %ws\n",
__FUNCTION__,
DllName,
@@ -1852,8 +1852,8 @@
/* Display debug output if snaps are on */
if (ShowSnaps)
{
- DbgPrintEx(81, //DPFLTR_LDR_ID,
- 0,
+ DbgPrintEx(DPFLTR_LDR_ID,
+ DPFLTR_ERROR_LEVEL,
"LDR: %s - Looking for %ws\n",
__FUNCTION__,
Buffer);
@@ -1932,16 +1932,16 @@
/* Check which output to use -- failure or success */
if (NT_SUCCESS(Status))
{
- DbgPrintEx(81, //DPFLTR_LDR_ID,
- 0,
+ DbgPrintEx(DPFLTR_LDR_ID,
+ DPFLTR_ERROR_LEVEL,
"LDR: %s - Returning %wZ\n",
__FUNCTION__,
*ExpandedName);
}
else
{
- DbgPrintEx(81, //DPFLTR_LDR_ID,
- 0,
+ DbgPrintEx(DPFLTR_LDR_ID,
+ DPFLTR_ERROR_LEVEL,
"LDR: %s - Unable to locate %ws in %ws: 0x%08x\n",
__FUNCTION__,
DllName,
@@ -2455,8 +2455,8 @@
sizeof(NameBuffer))
{
/* No space to add the extension */
- DbgPrintEx(81, //DPFLTR_LDR_ID,
- 0,
+ DbgPrintEx(DPFLTR_LDR_ID,
+ DPFLTR_ERROR_LEVEL,
"LDR: %s - Dll name missing extension; with extension "
"added the name is too long\n"
" DllName: (@ %p) \"%wZ\"\n"