UuidCompare (RPC Merge: A_PL1)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Microsoft is not so kind as to explain what less than
and greater than mean with respect to UUID's.
Who knows? Could be wrong, but I'll bet it's right!
Easy enough to test and find out, and surely better
than nothing.

Relative to (RPC Merge A_PL0)

LICENSE: X11

CHANGELOG:

* dlls/rpcrt4/rpcrt4.spec, dlls/rpcrt4/rpcrt4_main.c:
  Greg Turner <gmturner007@ameritech.net>
- UuidCompare


"If ye love wealth better than liberty, the tranquility
of servitude better than the animating contest of freedom,
go home from us in peace. We ask not your counsels or your
arms. Crouch down and lick the hands, which feed you. May
your chains set lightly upon you, and may posterity forget
that ye were our countrymen." 

-Samuel Adams
--- dlls/rpcrt4/rpcrt4_main.c.A_PL0	2002-10-03 21:49:02.000000000 -0500
+++ dlls/rpcrt4/rpcrt4_main.c	2002-10-03 22:08:39.000000000 -0500
@@ -136,14 +136,39 @@
  * RETURNS
  *     TRUE/FALSE
  */
-int WINAPI UuidEqual(UUID *uuid1, UUID *uuid2, RPC_STATUS *Status)
+int WINAPI UuidEqual(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status)
 {
-  TRACE("(%s,%s)\n", debugstr_guid(uuid1), debugstr_guid(uuid2));
+  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));
+  if (!Uuid1) Uuid1 = &uuid_nil;
+  if (!Uuid2) Uuid2 = &uuid_nil;
+  if (Uuid1 == Uuid2) return TRUE;
+  return !memcmp(Uuid1, Uuid2, sizeof(UUID));
+}
+
+/*************************************************************************
+ * UuidCompare [RPCRT4.@]
+ *
+ * (an educated-guess implementation)
+ *
+ * PARAMS
+ *     UUID *Uuid1        [I] Uuid to compare
+ *     UUID *Uuid2        [I] Uuid to compare
+ *     RPC_STATUS *Status [O] returns RPC_S_OK
+ * 
+ * RETURNS
+ *     -1 if Uuid1 is less than Uuid2
+ *     0  if Uuid1 and Uuid2 are equal
+ *     1  if Uuid1 is greater than Uuid2
+ */
+int WINAPI UuidCompare(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 0;
+  return memcmp(Uuid1, Uuid2, sizeof(UUID));
 }
 
 /*************************************************************************
--- dlls/rpcrt4/rpcrt4.spec.A_PL0	2002-10-03 21:49:17.000000000 -0500
+++ dlls/rpcrt4/rpcrt4.spec	2002-10-03 21:58:30.000000000 -0500
@@ -171,7 +171,7 @@
 @ stub TowerConstruct
 @ stub TowerExplode
 
-@ stub UuidCompare
+@ stdcall UuidCompare(ptr ptr ptr) UuidCompare
 @ stdcall UuidCreate(ptr) UuidCreate
 @ stdcall UuidCreateSequential(ptr) UuidCreateSequential # win 2000
 @ stdcall UuidCreateNil(ptr) UuidCreateNil

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux