Commit f9650f40 authored by Ove Kaaven's avatar Ove Kaaven Committed by Alexandre Julliard

Added UuidCreateNil, UuidEqual and UuidIsNil.

parent 54f22873
...@@ -174,12 +174,12 @@ init RPCRT4_LibMain ...@@ -174,12 +174,12 @@ init RPCRT4_LibMain
@ stub UuidCompare @ stub UuidCompare
@ stdcall UuidCreate(ptr) UuidCreate @ stdcall UuidCreate(ptr) UuidCreate
@ stdcall UuidCreateSequential(ptr) UuidCreateSequential # win 2000 @ stdcall UuidCreateSequential(ptr) UuidCreateSequential # win 2000
@ stub UuidCreateNil @ stdcall UuidCreateNil(ptr) UuidCreateNil
@ stub UuidEqual @ stdcall UuidEqual(ptr ptr ptr) UuidEqual
@ stdcall UuidFromStringA(ptr ptr) UuidFromStringA @ stdcall UuidFromStringA(str ptr) UuidFromStringA
@ stdcall UuidFromStringW(ptr ptr) UuidFromStringW @ stdcall UuidFromStringW(wstr ptr) UuidFromStringW
@ stdcall UuidHash(ptr ptr) UuidHash @ stdcall UuidHash(ptr ptr) UuidHash
@ stub UuidIsNil @ stdcall UuidIsNil(ptr ptr) UuidIsNil
@ stdcall UuidToStringA(ptr ptr) UuidToStringA @ stdcall UuidToStringA(ptr ptr) UuidToStringA
@ stub UuidToStringW @ stub UuidToStringW
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "wine/windef16.h" #include "wine/windef16.h"
#include "winerror.h" #include "winerror.h"
#include "winbase.h" #include "winbase.h"
#include "wine/unicode.h"
#include "rpc.h" #include "rpc.h"
#include "ole2.h" #include "ole2.h"
...@@ -64,6 +65,8 @@ ...@@ -64,6 +65,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DEFAULT_DEBUG_CHANNEL(ole);
static UUID uuid_nil;
/*********************************************************************** /***********************************************************************
* RPCRT4_LibMain * RPCRT4_LibMain
* *
...@@ -92,6 +95,60 @@ RPCRT4_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) ...@@ -92,6 +95,60 @@ RPCRT4_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
} }
/************************************************************************* /*************************************************************************
* UuidEqual [RPCRT4.@]
*
* PARAMS
* UUID *Uuid1 [I] Uuid to compare
* UUID *Uuid2 [I] Uuid to compare
* RPC_STATUS *Status [O] returns RPC_S_OK
*
* RETURNS
* TRUE/FALSE
*/
int WINAPI UuidEqual(UUID *uuid1, UUID *uuid2, RPC_STATUS *Status)
{
TRACE("(%s,%s)\n", debugstr_guid(uuid1), debugstr_guid(uuid2));
*Status = RPC_S_OK;
if (!uuid1) uuid1 = &uuid_nil;
if (!uuid2) uuid2 = &uuid_nil;
if (uuid1 == uuid2) return TRUE;
return !memcmp(uuid1, uuid2, sizeof(UUID));
}
/*************************************************************************
* UuidIsNil [RPCRT4.@]
*
* PARAMS
* UUID *Uuid [I] Uuid to compare
* RPC_STATUS *Status [O] retuns RPC_S_OK
*
* RETURNS
* TRUE/FALSE
*/
int WINAPI UuidIsNil(UUID *uuid, RPC_STATUS *Status)
{
TRACE("(%s)\n", debugstr_guid(uuid));
*Status = RPC_S_OK;
if (!uuid) return TRUE;
return !memcmp(uuid, &uuid_nil, sizeof(UUID));
}
/*************************************************************************
* UuidCreateNil [RPCRT4.@]
*
* PARAMS
* UUID *Uuid [O] returns a nil UUID
*
* RETURNS
* RPC_S_OK
*/
RPC_STATUS WINAPI UuidCreateNil(UUID *Uuid)
{
*Uuid = uuid_nil;
return RPC_S_OK;
}
/*************************************************************************
* UuidCreate [RPCRT4.@] * UuidCreate [RPCRT4.@]
* *
* Creates a 128bit UUID. * Creates a 128bit UUID.
...@@ -109,11 +166,11 @@ RPC_STATUS WINAPI UuidCreate(UUID *Uuid) ...@@ -109,11 +166,11 @@ RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
static 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 WORD clock_seq;
struct timeval tv; struct timeval tv;
unsigned long long clock_reg; unsigned long long clock_reg;
UINT clock_high, clock_low; DWORD clock_high, clock_low;
UINT16 temp_clock_seq, temp_clock_mid, temp_clock_hi_and_version; WORD temp_clock_seq, temp_clock_mid, temp_clock_hi_and_version;
#ifdef HAVE_NET_IF_H #ifdef HAVE_NET_IF_H
int sd; int sd;
struct ifreq ifr, *ifrp; struct ifreq ifr, *ifrp;
...@@ -252,7 +309,7 @@ sizeof((i).ifr_name)+(i).ifr_addr.sa_len) ...@@ -252,7 +309,7 @@ sizeof((i).ifr_name)+(i).ifr_addr.sa_len)
clock_high = clock_reg >> 32; clock_high = clock_reg >> 32;
clock_low = clock_reg; clock_low = clock_reg;
temp_clock_seq = clock_seq | 0x8000; temp_clock_seq = clock_seq | 0x8000;
temp_clock_mid = (UINT16)clock_high; temp_clock_mid = (WORD)clock_high;
temp_clock_hi_and_version = (clock_high >> 16) | 0x1000; temp_clock_hi_and_version = (clock_high >> 16) | 0x1000;
/* pack the information into the GUID structure */ /* pack the information into the GUID structure */
......
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