2 * Helper functions for ntdll
9 #include "debugtools.h"
10 #include "ntdll_misc.h"
12 DEFAULT_DEBUG_CHANNEL(ntdll);
14 #if defined(__GNUC__) && defined(__i386__)
15 #define DO_FPU(x,y) __asm__ __volatile__( x " %0;fwait" : "=m" (y) : )
16 #define POP_FPU(x) DO_FPU("fstpl",x)
19 void dump_ObjectAttributes (const OBJECT_ATTRIBUTES *oa)
22 TRACE("%p:(name=%s, attr=0x%08lx, hRoot=0x%08x, sd=%p) \n",
23 oa, debugstr_us(oa->ObjectName),
24 oa->Attributes, oa->RootDirectory, oa->SecurityDescriptor);
27 void dump_UnicodeString(const UNICODE_STRING *us, BOOLEAN showstring)
32 TRACE("%p %p(%s) (%u %u)\n", us, us->Buffer, debugstr_us(us), us->Length, us->MaximumLength);
34 TRACE("%p %p(<OUT>) (%u %u)\n", us, us->Buffer, us->Length, us->MaximumLength);
38 LPCSTR debugstr_as( const STRING *str )
40 if (!str) return "<null>";
41 return debugstr_an(str->Buffer, str->Length);
44 LPCSTR debugstr_us( const UNICODE_STRING *us )
46 if (!us) return "<null>";
47 return debugstr_wn(us->Buffer, us->Length);
50 /*********************************************************************
56 #if defined(__GNUC__) && defined(__i386__)
57 LONG __cdecl NTDLL__ftol(void)
59 /* don't just do DO_FPU("fistp",retval), because the rounding
60 * mode must also be set to "round towards zero"... */
65 #endif /* defined(__GNUC__) && defined(__i386__) */
67 /*********************************************************************
71 * Should be register function
75 #if !defined(__GNUC__) & defined(__i386__)
76 LONG __cdecl NTDLL__ftol(double fl)
78 FIXME("should be register function\n");
81 #endif /* !defined(__GNUC__) && defined(__i386__) */
83 /*********************************************************************
89 LONG __cdecl NTDLL__ftol(double fl)
93 #endif /* !defined(__i386__) */
95 /*********************************************************************
100 #if defined(__GNUC__) && defined(__i386__)
101 double __cdecl NTDLL__CIpow(void)
108 #endif /* defined(__GNUC__) && defined(__i386__) */
111 /*********************************************************************
115 * Should be register function
120 #if !defined(__GNUC__) && defined(__i386__)
121 double __cdecl NTDLL__CIpow(double x,double y)
123 FIXME("should be register function\n");
126 #endif /* !defined(__GNUC__) && defined(__i386__) */
128 /*********************************************************************
134 double __cdecl NTDLL__CIpow(double x,double y)
138 #endif /* !defined(__i386__) */