Commit 948d39c5 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

ntoskrnl.exe: Implement ExUuidCreate().

This is mostly a copy of UuidCreate() in rpcrt4 with NTSTATUS return code. Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 1eaa5976
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment