No longer directly accessing debuggee memory.
[wine] / dlls / ntdll / misc.c
1 /*
2  * Helper functions for ntdll
3  */
4 #include <time.h>
5
6 #include "config.h"
7
8 #include "debugtools.h"
9 #include "ntdll_misc.h"
10
11 DEFAULT_DEBUG_CHANNEL(ntdll);
12
13 void dump_ObjectAttributes (POBJECT_ATTRIBUTES oa)
14 {
15         if (oa)
16           TRACE("%p:(name=%s, attr=0x%08lx, hRoot=0x%08x, sd=%p) \n",
17             oa, debugstr_us(oa->ObjectName),
18             oa->Attributes, oa->RootDirectory, oa->SecurityDescriptor);
19 }
20
21 void dump_AnsiString(PANSI_STRING as, BOOLEAN showstring)
22 {
23         if (as)
24         {
25           if (showstring)
26             TRACE("%p %p(%s) (%u %u)\n", as, as->Buffer, debugstr_as(as), as->Length, as->MaximumLength);
27           else
28             TRACE("%p %p(<OUT>) (%u %u)\n", as, as->Buffer, as->Length, as->MaximumLength);
29         }
30 }
31
32 void dump_UnicodeString(PUNICODE_STRING us, BOOLEAN showstring)
33 {
34         if (us)
35         {
36           if (showstring)
37             TRACE("%p %p(%s) (%u %u)\n", us, us->Buffer, debugstr_us(us), us->Length, us->MaximumLength);
38           else
39             TRACE("%p %p(<OUT>) (%u %u)\n", us, us->Buffer, us->Length, us->MaximumLength);
40         }
41 }
42
43 LPCSTR debugstr_as (PANSI_STRING us)
44 {
45         if (!us) return NULL;
46         return debugstr_an(us->Buffer, us->Length);
47 }
48
49 LPCSTR debugstr_us (PUNICODE_STRING us)
50 {
51         if (!us) return NULL;
52         return debugstr_wn(us->Buffer, us->Length);
53 }
54