- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
/*
|
|
|
|
* Helper functions for ntdll
|
|
|
|
*/
|
|
|
|
#include <time.h>
|
2000-06-24 14:50:56 +02:00
|
|
|
#include <math.h>
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include "debugtools.h"
|
|
|
|
#include "ntdll_misc.h"
|
|
|
|
|
2000-01-29 20:49:58 +01:00
|
|
|
DEFAULT_DEBUG_CHANNEL(ntdll);
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
|
2000-06-23 18:16:30 +02:00
|
|
|
#if defined(__GNUC__) && defined(__i386__)
|
|
|
|
#define DO_FPU(x,y) __asm__ __volatile__( x " %0;fwait" : "=m" (y) : )
|
|
|
|
#define POP_FPU(x) DO_FPU("fstpl",x)
|
|
|
|
#endif
|
|
|
|
|
2000-10-15 02:39:11 +02:00
|
|
|
void dump_ObjectAttributes (const OBJECT_ATTRIBUTES *oa)
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
{
|
|
|
|
if (oa)
|
|
|
|
TRACE("%p:(name=%s, attr=0x%08lx, hRoot=0x%08x, sd=%p) \n",
|
|
|
|
oa, debugstr_us(oa->ObjectName),
|
|
|
|
oa->Attributes, oa->RootDirectory, oa->SecurityDescriptor);
|
|
|
|
}
|
|
|
|
|
2000-10-15 02:39:11 +02:00
|
|
|
void dump_UnicodeString(const UNICODE_STRING *us, BOOLEAN showstring)
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
{
|
|
|
|
if (us)
|
|
|
|
{
|
|
|
|
if (showstring)
|
|
|
|
TRACE("%p %p(%s) (%u %u)\n", us, us->Buffer, debugstr_us(us), us->Length, us->MaximumLength);
|
|
|
|
else
|
|
|
|
TRACE("%p %p(<OUT>) (%u %u)\n", us, us->Buffer, us->Length, us->MaximumLength);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-08-26 23:16:36 +02:00
|
|
|
LPCSTR debugstr_as( const STRING *str )
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
{
|
2000-08-26 23:16:36 +02:00
|
|
|
if (!str) return "<null>";
|
|
|
|
return debugstr_an(str->Buffer, str->Length);
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
}
|
|
|
|
|
2000-08-26 23:16:36 +02:00
|
|
|
LPCSTR debugstr_us( const UNICODE_STRING *us )
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
{
|
2000-08-26 23:16:36 +02:00
|
|
|
if (!us) return "<null>";
|
|
|
|
return debugstr_wn(us->Buffer, us->Length);
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
}
|
|
|
|
|
2000-06-23 18:16:30 +02:00
|
|
|
/*********************************************************************
|
2001-06-21 01:03:14 +02:00
|
|
|
* _ftol (NTDLL.@)
|
2000-12-03 00:44:59 +01:00
|
|
|
*
|
|
|
|
* VERSION
|
|
|
|
* [GNUC && i386]
|
2000-06-23 18:16:30 +02:00
|
|
|
*/
|
2000-12-03 00:44:59 +01:00
|
|
|
#if defined(__GNUC__) && defined(__i386__)
|
2000-06-23 18:16:30 +02:00
|
|
|
LONG __cdecl NTDLL__ftol(void)
|
|
|
|
{
|
|
|
|
/* don't just do DO_FPU("fistp",retval), because the rounding
|
|
|
|
* mode must also be set to "round towards zero"... */
|
|
|
|
double fl;
|
|
|
|
POP_FPU(fl);
|
|
|
|
return (LONG)fl;
|
|
|
|
}
|
2000-12-03 00:44:59 +01:00
|
|
|
#endif /* defined(__GNUC__) && defined(__i386__) */
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-06-21 01:03:14 +02:00
|
|
|
* _ftol (NTDLL.@)
|
2000-12-03 00:44:59 +01:00
|
|
|
*
|
|
|
|
* FIXME
|
|
|
|
* Should be register function
|
|
|
|
* VERSION
|
|
|
|
* [!GNUC && i386]
|
|
|
|
*/
|
2001-07-26 23:41:22 +02:00
|
|
|
#if !defined(__GNUC__) && defined(__i386__)
|
2000-06-23 18:16:30 +02:00
|
|
|
LONG __cdecl NTDLL__ftol(double fl)
|
|
|
|
{
|
|
|
|
FIXME("should be register function\n");
|
|
|
|
return (LONG)fl;
|
|
|
|
}
|
2000-12-03 00:44:59 +01:00
|
|
|
#endif /* !defined(__GNUC__) && defined(__i386__) */
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-06-21 01:03:14 +02:00
|
|
|
* _ftol (NTDLL.@)
|
2000-12-03 00:44:59 +01:00
|
|
|
* VERSION
|
|
|
|
* [!i386]
|
|
|
|
*/
|
|
|
|
#ifndef __i386__
|
|
|
|
LONG __cdecl NTDLL__ftol(double fl)
|
|
|
|
{
|
|
|
|
return (LONG) fl;
|
|
|
|
}
|
|
|
|
#endif /* !defined(__i386__) */
|
2000-06-23 18:16:30 +02:00
|
|
|
|
|
|
|
/*********************************************************************
|
2001-06-21 01:03:14 +02:00
|
|
|
* _CIpow (NTDLL.@)
|
2000-12-03 00:44:59 +01:00
|
|
|
* VERSION
|
|
|
|
* [GNUC && i386]
|
2000-06-23 18:16:30 +02:00
|
|
|
*/
|
2000-12-03 00:44:59 +01:00
|
|
|
#if defined(__GNUC__) && defined(__i386__)
|
2000-11-25 03:11:26 +01:00
|
|
|
double __cdecl NTDLL__CIpow(void)
|
2000-06-23 18:16:30 +02:00
|
|
|
{
|
|
|
|
double x,y;
|
|
|
|
POP_FPU(y);
|
|
|
|
POP_FPU(x);
|
|
|
|
return pow(x,y);
|
|
|
|
}
|
2000-12-03 00:44:59 +01:00
|
|
|
#endif /* defined(__GNUC__) && defined(__i386__) */
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-06-21 01:03:14 +02:00
|
|
|
* _CIpow (NTDLL.@)
|
2000-12-03 00:44:59 +01:00
|
|
|
*
|
|
|
|
* FIXME
|
|
|
|
* Should be register function
|
|
|
|
*
|
|
|
|
* VERSION
|
|
|
|
* [!GNUC && i386]
|
|
|
|
*/
|
|
|
|
#if !defined(__GNUC__) && defined(__i386__)
|
2000-11-25 03:11:26 +01:00
|
|
|
double __cdecl NTDLL__CIpow(double x,double y)
|
2000-06-23 18:16:30 +02:00
|
|
|
{
|
|
|
|
FIXME("should be register function\n");
|
|
|
|
return pow(x,y);
|
|
|
|
}
|
2000-12-03 00:44:59 +01:00
|
|
|
#endif /* !defined(__GNUC__) && defined(__i386__) */
|
|
|
|
|
|
|
|
/*********************************************************************
|
2001-06-21 01:03:14 +02:00
|
|
|
* _CIpow (NTDLL.@)
|
2000-12-03 00:44:59 +01:00
|
|
|
* VERSION
|
|
|
|
* [!i386]
|
|
|
|
*/
|
|
|
|
#ifndef __i386__
|
|
|
|
double __cdecl NTDLL__CIpow(double x,double y)
|
|
|
|
{
|
|
|
|
return pow(x,y);
|
|
|
|
}
|
|
|
|
#endif /* !defined(__i386__) */
|
|
|
|
|
|
|
|
|