ntoskrnl.exe: Implement ExUuidCreate().
This is mostly a copy of UuidCreate() in rpcrt4 with NTSTATUS return code. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1eaa59765f
commit
948d39c529
@ -41,6 +41,7 @@
|
||||
#include "dbt.h"
|
||||
#include "winreg.h"
|
||||
#include "setupapi.h"
|
||||
#include "ntsecapi.h"
|
||||
#include "ddk/csq.h"
|
||||
#include "ddk/ntddk.h"
|
||||
#include "ddk/ntifs.h"
|
||||
@ -4128,3 +4129,35 @@ static struct _OBJECT_TYPE token_type =
|
||||
};
|
||||
|
||||
POBJECT_TYPE SeTokenObjectType = &token_type;
|
||||
|
||||
/*************************************************************************
|
||||
* ExUuidCreate (NTOSKRNL.@)
|
||||
*
|
||||
* Creates a 128bit UUID.
|
||||
*
|
||||
* RETURNS
|
||||
*
|
||||
* STATUS_SUCCESS if successful.
|
||||
* RPC_NT_UUID_LOCAL_ONLY if UUID is only locally unique.
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
* Follows RFC 4122, section 4.4 (Algorithms for Creating a UUID from
|
||||
* Truly Random or Pseudo-Random Numbers)
|
||||
*/
|
||||
NTSTATUS WINAPI ExUuidCreate(UUID *uuid)
|
||||
{
|
||||
RtlGenRandom(uuid, sizeof(*uuid));
|
||||
/* Clear the version bits and set the version (4) */
|
||||
uuid->Data3 &= 0x0fff;
|
||||
uuid->Data3 |= (4 << 12);
|
||||
/* Set the topmost bits of Data4 (clock_seq_hi_and_reserved) as
|
||||
* specified in RFC 4122, section 4.4.
|
||||
*/
|
||||
uuid->Data4[0] &= 0x3f;
|
||||
uuid->Data4[0] |= 0x80;
|
||||
|
||||
TRACE("%s\n", debugstr_guid(uuid));
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -185,7 +185,7 @@
|
||||
@ stub ExSystemExceptionFilter
|
||||
@ stdcall ExSystemTimeToLocalTime(ptr ptr) RtlSystemTimeToLocalTime
|
||||
@ stub ExUnregisterCallback
|
||||
@ stub ExUuidCreate
|
||||
@ stdcall ExUuidCreate(ptr)
|
||||
@ stub ExVerifySuite
|
||||
@ stub ExWindowStationObjectType
|
||||
@ stub Exi386InterlockedDecrementLong
|
||||
|
@ -202,7 +202,9 @@ typedef NTSTATUS (WINAPI *PIO_QUERY_DEVICE_ROUTINE)(PVOID,PUNICODE_STRING,INTERF
|
||||
PKEY_VALUE_FULL_INFORMATION*,CONFIGURATION_TYPE,ULONG,PKEY_VALUE_FULL_INFORMATION*);
|
||||
typedef void (NTAPI EXPAND_STACK_CALLOUT)(void*);
|
||||
typedef EXPAND_STACK_CALLOUT *PEXPAND_STACK_CALLOUT;
|
||||
typedef GUID UUID;
|
||||
|
||||
NTSTATUS WINAPI ExUuidCreate(UUID*);
|
||||
NTSTATUS WINAPI IoQueryDeviceDescription(PINTERFACE_TYPE,PULONG,PCONFIGURATION_TYPE,PULONG,
|
||||
PCONFIGURATION_TYPE,PULONG,PIO_QUERY_DEVICE_ROUTINE,PVOID);
|
||||
void WINAPI IoRegisterDriverReinitialization(PDRIVER_OBJECT,PDRIVER_REINITIALIZE,PVOID);
|
||||
|
Loading…
x
Reference in New Issue
Block a user