Commit 9aa54a90 authored by Mark G. Adams's avatar Mark G. Adams Committed by Alexandre Julliard

Fix UuidCreate() to not forget MAC address.

Remove {}'s from UuidToStringA() output. Add UuidCreateSequential() function from Windows 2000.
parent 5ea3031c
...@@ -179,6 +179,7 @@ debug_channels (ole) ...@@ -179,6 +179,7 @@ debug_channels (ole)
@ stub UuidCompare @ stub UuidCompare
@ stdcall UuidCreate(ptr) UuidCreate @ stdcall UuidCreate(ptr) UuidCreate
@ stdcall UuidCreateSequential(ptr) UuidCreateSequential # win 2000
@ stub UuidCreateNil @ stub UuidCreateNil
@ stub UuidEqual @ stub UuidEqual
@ stub UuidFromStringA @ stub UuidFromStringA
......
...@@ -81,7 +81,7 @@ RPCRT4_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) ...@@ -81,7 +81,7 @@ RPCRT4_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
RPC_STATUS WINAPI UuidCreate(UUID *Uuid) RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
{ {
static char has_init = 0; static char has_init = 0;
unsigned char a[6]; static unsigned char a[6];
static int adjustment = 0; static int adjustment = 0;
static struct timeval last = {0, 0}; static struct timeval last = {0, 0};
static UINT16 clock_seq; static UINT16 clock_seq;
...@@ -96,7 +96,7 @@ RPC_STATUS WINAPI UuidCreate(UUID *Uuid) ...@@ -96,7 +96,7 @@ RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
char buf[1024]; char buf[1024];
int n, i; int n, i;
#endif #endif
/* Have we already tried to get the MAC address? */ /* Have we already tried to get the MAC address? */
if (!has_init) { if (!has_init) {
#ifdef HAVE_NET_IF_H #ifdef HAVE_NET_IF_H
...@@ -264,6 +264,20 @@ sizeof((i).ifr_name)+(i).ifr_addr.sa_len) ...@@ -264,6 +264,20 @@ sizeof((i).ifr_name)+(i).ifr_addr.sa_len)
return RPC_S_OK; return RPC_S_OK;
} }
/*************************************************************************
* UuidCreateSequential [RPCRT4.@]
*
* Creates a 128bit UUID by calling UuidCreate.
* New API in Win 2000
*/
RPC_STATUS WINAPI UuidCreateSequential(UUID *Uuid)
{
return UuidCreate (Uuid);
}
/************************************************************************* /*************************************************************************
* RpcStringFreeA [RPCRT4.@] * RpcStringFreeA [RPCRT4.@]
* *
...@@ -314,7 +328,7 @@ RPC_STATUS WINAPI UuidToStringA(UUID *Uuid, unsigned char** StringUuid) ...@@ -314,7 +328,7 @@ RPC_STATUS WINAPI UuidToStringA(UUID *Uuid, unsigned char** StringUuid)
if(!(*StringUuid)) if(!(*StringUuid))
return RPC_S_OUT_OF_MEMORY; return RPC_S_OUT_OF_MEMORY;
sprintf(*StringUuid, "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", sprintf(*StringUuid, "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
Uuid->Data1, Uuid->Data2, Uuid->Data3, Uuid->Data1, Uuid->Data2, Uuid->Data3,
Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2], Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2],
Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5], Uuid->Data4[3], Uuid->Data4[4], Uuid->Data4[5],
......
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