RPC Merge (A_PL0)

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

 



From Jürgen Schmied's RPC patches.
Minor changes may exist between this and the original 
patch but it's intended to be basically the same stuff.

LICENSE: X11

CHANGELOG:

* dlls/rpcrt4/rpcrt4.spec, dlls/rpcrt4/rpcrt4_main.c:
  Ove Kaaven <ovek@transgaming.com>
- RPCStringFreeW, UUIDHash, administrivia

-- 
gmt

"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
Index: dlls/rpcrt4/rpcrt4.spec
===================================================================
RCS file: /home/wine/wine/dlls/rpcrt4/rpcrt4.spec,v
retrieving revision 1.19
diff -u -r1.19 rpcrt4.spec
--- dlls/rpcrt4/rpcrt4.spec	3 Oct 2002 22:51:49 -0000	1.19
+++ dlls/rpcrt4/rpcrt4.spec	4 Oct 2002 02:41:00 -0000
@@ -165,7 +165,7 @@
 @ stub RpcStringBindingParseA
 @ stub RpcStringBindingParseW
 @ stdcall RpcStringFreeA(ptr) RpcStringFreeA
-@ stub RpcStringFreeW
+@ stdcall RpcStringFreeW(ptr) RpcStringFreeW
 @ stub RpcTestCancel
 
 @ stub TowerConstruct
Index: dlls/rpcrt4/rpcrt4_main.c
===================================================================
RCS file: /home/wine/wine/dlls/rpcrt4/rpcrt4_main.c,v
retrieving revision 1.29
diff -u -r1.29 rpcrt4_main.c
--- dlls/rpcrt4/rpcrt4_main.c	4 Oct 2002 00:20:56 -0000	1.29
+++ dlls/rpcrt4/rpcrt4_main.c	4 Oct 2002 02:41:00 -0000
@@ -32,7 +32,6 @@
 #endif
 
 #include "windef.h"
-#include "wine/windef16.h"
 #include "winerror.h"
 #include "winbase.h"
 #include "wine/unicode.h"
@@ -95,6 +94,38 @@
 }
 
 /*************************************************************************
+ *           RpcStringFreeA   [RPCRT4.@]
+ *
+ * Frees a character string allocated by the RPC run-time library.
+ *
+ * RETURNS
+ *
+ *  S_OK if successful.
+ */
+RPC_STATUS WINAPI RpcStringFreeA(LPSTR* String)
+{
+  HeapFree( GetProcessHeap(), 0, *String);
+
+  return RPC_S_OK;
+}
+
+/*************************************************************************
+ *           RpcStringFreeW   [RPCRT4.@]
+ *
+ * Frees a character string allocated by the RPC run-time library.
+ *
+ * RETURNS
+ *
+ *  S_OK if successful.
+ */
+RPC_STATUS WINAPI RpcStringFreeW(LPWSTR* String)
+{
+  HeapFree( GetProcessHeap(), 0, *String);
+
+  return RPC_S_OK;
+}
+
+/*************************************************************************
  * UuidEqual [RPCRT4.@]
  *
  * PARAMS
@@ -353,7 +384,6 @@
  * Creates a 128bit UUID by calling UuidCreate.
  * New API in Win 2000
  */
-
 RPC_STATUS WINAPI UuidCreateSequential(UUID *Uuid)
 {
    return UuidCreate (Uuid);
@@ -361,33 +391,34 @@
 
 
 /*************************************************************************
- *           RpcStringFreeA   [RPCRT4.@]
+ *           UuidHash   [RPCRT4.@]
  *
- * Frees a character string allocated by the RPC run-time library.
+ * Generates a hash value for a given UUID
  *
- * RETURNS
+ * Code based on FreeDCE implementation
  *
- *  S_OK if successful.
  */
-RPC_STATUS WINAPI RpcStringFreeA(LPSTR* String)
+unsigned short WINAPI UuidHash(UUID *uuid, RPC_STATUS *Status)
 {
-  HeapFree( GetProcessHeap(), 0, *String);
+  BYTE *data = (BYTE*)uuid;
+  short c0 = 0, c1 = 0, x, y;
+  int i;
 
-  return RPC_S_OK;
-}
+  TRACE("(%s)\n", debugstr_guid(uuid));
 
+  for (i=0; i<sizeof(UUID); i++) {
+    c0 += data[i];
+    c1 += c0;
+  }
+
+  x = -c1 % 255;
+  if (x < 0) x += 255;
+
+  y = (c1 - c0) % 255;
+  if (y < 0) y += 255;
 
-/*************************************************************************
- *           UuidHash   [RPCRT4.@]
- *
- * Generates a hash value for a given UUID
- *
- */
-unsigned short WINAPI UuidHash(UUID *uuid, RPC_STATUS *Status)
-{
-  FIXME("stub:\n");
   *Status = RPC_S_OK;
-  return 0xabcd;
+  return y*256 + x;
 }
 
 /*************************************************************************

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

  Powered by Linux