Fix ntdll/tests/reg.c compilation with the PSDK

Francois Gouget fgouget at free.fr
Wed Aug 10 07:36:51 CDT 2005


Changelog:

  * dlls/ntdll/tests/reg.c

    Francois Gouget <fgouget at free.fr>
    Remove unneeded wine/library.h include.
    Use lstrlenW() instead of the Wine-specific strlenW(). This also lets 
us get rid of the wine/unicode.h include.
    Define the InitializeObjectAttributes() macro if not using Wine's 
winternl.h header.

-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
                          Stolen from an Internet user:
               "f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng !"
-------------- next part --------------
Index: dlls/ntdll/tests/reg.c
===================================================================
RCS file: /var/cvs/wine/dlls/ntdll/tests/reg.c,v
retrieving revision 1.5
diff -u -p -r1.5 reg.c
--- dlls/ntdll/tests/reg.c	20 Jun 2005 14:18:04 -0000	1.5
+++ dlls/ntdll/tests/reg.c	28 Jul 2005 14:43:01 -0000
@@ -24,12 +24,10 @@
 
 #include "ntdll_test.h"
 #include "winternl.h"
-#include "wine/library.h"
 #include "stdio.h"
 #include "winnt.h"
 #include "winnls.h"
 #include "stdlib.h"
-#include "wine/unicode.h"
 
 #ifndef __WINE_WINTERNL_H
 
@@ -69,6 +67,16 @@ typedef struct _RTL_QUERY_REGISTRY_TABLE
   ULONG  DefaultLength;
 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
 
+#define InitializeObjectAttributes(p,n,a,r,s) \
+    do { \
+        (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
+        (p)->RootDirectory = r; \
+        (p)->Attributes = a; \
+        (p)->ObjectName = n; \
+        (p)->SecurityDescriptor = s; \
+        (p)->SecurityQualityOfService = NULL; \
+    } while (0)
+
 #endif
 
 static NTSTATUS (WINAPI * pRtlCreateUnicodeStringFromAsciiz)(PUNICODE_STRING, LPCSTR);
@@ -151,7 +159,7 @@ static NTSTATUS WINAPI QueryRoutine (IN 
 
     if(ValueName)
     {
-        ValueNameLength = strlenW(ValueName);
+        ValueNameLength = lstrlenW(ValueName);
 
         ValName = (LPSTR)pRtlAllocateHeap(GetProcessHeap(), 0, ValueNameLength);
 


More information about the wine-patches mailing list