2 * Helper functions for ntdll
4 * Copyright 2000 Juergen Schmied
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #ifdef HAVE_SYS_UTSNAME_H
26 #include <sys/utsname.h>
29 #include "wine/library.h"
30 #include "wine/debug.h"
31 #include "ntdll_misc.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(ntdll
);
35 #if defined(__GNUC__) && defined(__i386__)
36 #define DO_FPU(x,y) __asm__ __volatile__( x " %0;fwait" : "=m" (y) : )
37 #define POP_FPU(x) DO_FPU("fstpl",x)
40 LPCSTR
debugstr_ObjectAttributes(const OBJECT_ATTRIBUTES
*oa
)
42 if (!oa
) return "<null>";
43 return wine_dbg_sprintf( "{name=%s, attr=0x%08x, hRoot=%p, sd=%p}\n",
44 debugstr_us(oa
->ObjectName
), oa
->Attributes
,
45 oa
->RootDirectory
, oa
->SecurityDescriptor
);
48 LPCSTR
debugstr_us( const UNICODE_STRING
*us
)
50 if (!us
) return "<null>";
51 return debugstr_wn(us
->Buffer
, us
->Length
/ sizeof(WCHAR
));
54 /*********************************************************************
60 #if defined(__GNUC__) && defined(__i386__)
61 LONGLONG CDECL
NTDLL__ftol(void)
63 /* don't just do DO_FPU("fistp",retval), because the rounding
64 * mode must also be set to "round towards zero"... */
69 #endif /* defined(__GNUC__) && defined(__i386__) */
71 /*********************************************************************
75 * Should be register function
79 #if !defined(__GNUC__) && defined(__i386__)
80 LONGLONG CDECL
NTDLL__ftol(double fl
)
82 FIXME("should be register function\n");
85 #endif /* !defined(__GNUC__) && defined(__i386__) */
87 /*********************************************************************
92 #if defined(__GNUC__) && defined(__i386__)
93 double CDECL
NTDLL__CIpow(void)
100 #endif /* defined(__GNUC__) && defined(__i386__) */
103 /*********************************************************************
107 * Should be register function
112 #if !defined(__GNUC__) && defined(__i386__)
113 double CDECL
NTDLL__CIpow(double x
,double y
)
115 FIXME("should be register function\n");
118 #endif /* !defined(__GNUC__) && defined(__i386__) */
120 /*********************************************************************
121 * wine_get_version (NTDLL.@)
123 const char * CDECL
NTDLL_wine_get_version(void)
125 return wine_get_version();
128 /*********************************************************************
129 * wine_get_build_id (NTDLL.@)
131 const char * CDECL
NTDLL_wine_get_build_id(void)
133 return wine_get_build_id();
136 /*********************************************************************
137 * wine_get_host_version (NTDLL.@)
139 void CDECL
NTDLL_wine_get_host_version( const char **sysname
, const char **release
)
141 #ifdef HAVE_SYS_UTSNAME_H
142 static struct utsname buf
;
143 static int init_done
;
150 if (sysname
) *sysname
= buf
.sysname
;
151 if (release
) *release
= buf
.release
;
153 if (sysname
) *sysname
= "";
154 if (release
) *release
= "";
158 /*********************************************************************
161 int CDECL
NTDLL_abs( int i
)
166 /*********************************************************************
169 LONG CDECL
NTDLL_labs( LONG i
)
174 /*********************************************************************
177 double CDECL
NTDLL_atan( double d
)
182 /*********************************************************************
185 double CDECL
NTDLL_ceil( double d
)
190 /*********************************************************************
193 double CDECL
NTDLL_cos( double d
)
198 /*********************************************************************
201 double CDECL
NTDLL_fabs( double d
)
206 /*********************************************************************
209 double CDECL
NTDLL_floor( double d
)
214 /*********************************************************************
217 double CDECL
NTDLL_log( double d
)
222 /*********************************************************************
225 double CDECL
NTDLL_pow( double x
, double y
)
230 /*********************************************************************
233 double CDECL
NTDLL_sin( double d
)
238 /*********************************************************************
241 double CDECL
NTDLL_sqrt( double d
)
246 /*********************************************************************
249 double CDECL
NTDLL_tan( double d
)