Fixed a few prototypes.
[wine/dcerpc.git] / dlls / ntdll / misc.c
blobc4d31096001da58856bff6aa3c6e44bc85bd942a
1 /*
2 * Helper functions for ntdll
3 */
4 #include <time.h>
5 #include <math.h>
7 #include "config.h"
9 #include "debugtools.h"
10 #include "ntdll_misc.h"
12 DEFAULT_DEBUG_CHANNEL(ntdll);
14 #if defined(__GNUC__) && defined(__i386__)
15 #define USING_REAL_FPU
16 #define DO_FPU(x,y) __asm__ __volatile__( x " %0;fwait" : "=m" (y) : )
17 #define POP_FPU(x) DO_FPU("fstpl",x)
18 #endif
20 void dump_ObjectAttributes (const OBJECT_ATTRIBUTES *oa)
22 if (oa)
23 TRACE("%p:(name=%s, attr=0x%08lx, hRoot=0x%08x, sd=%p) \n",
24 oa, debugstr_us(oa->ObjectName),
25 oa->Attributes, oa->RootDirectory, oa->SecurityDescriptor);
28 void dump_UnicodeString(const UNICODE_STRING *us, BOOLEAN showstring)
30 if (us)
32 if (showstring)
33 TRACE("%p %p(%s) (%u %u)\n", us, us->Buffer, debugstr_us(us), us->Length, us->MaximumLength);
34 else
35 TRACE("%p %p(<OUT>) (%u %u)\n", us, us->Buffer, us->Length, us->MaximumLength);
39 LPCSTR debugstr_as( const STRING *str )
41 if (!str) return "<null>";
42 return debugstr_an(str->Buffer, str->Length);
45 LPCSTR debugstr_us( const UNICODE_STRING *us )
47 if (!us) return "<null>";
48 return debugstr_wn(us->Buffer, us->Length);
51 /*********************************************************************
52 * _ftol (NTDLL)
54 #ifdef USING_REAL_FPU
55 LONG __cdecl NTDLL__ftol(void)
57 /* don't just do DO_FPU("fistp",retval), because the rounding
58 * mode must also be set to "round towards zero"... */
59 double fl;
60 POP_FPU(fl);
61 return (LONG)fl;
63 #else
64 LONG __cdecl NTDLL__ftol(double fl)
66 FIXME("should be register function\n");
67 return (LONG)fl;
69 #endif
71 /*********************************************************************
72 * _CIpow (NTDLL)
74 #ifdef USING_REAL_FPU
75 LONG __cdecl NTDLL__CIpow(void)
77 double x,y;
78 POP_FPU(y);
79 POP_FPU(x);
80 return pow(x,y);
82 #else
83 LONG __cdecl NTDLL__CIpow(double x,double y)
85 FIXME("should be register function\n");
86 return pow(x,y);
88 #endif