Some misc. fixes and beautification. LICENSE: X11 CHANGELOG: * dlls/rpcrt4: rpc_binding.c rpcrt4_main.c; tools/winapi: win32.api: Greg Turner <gmturner007@ameritech.net> - remove stupid indentations from trace msgs - update the rpc TODO list a bit - add some constants for winapi_check - nil pointer support for some UUID functions (spotted by Olivier Evalet) -- gmt "The purpose of government is to rein in the rights of the people" --President Bill Clinton, MTV interview, 1993
diff -ur -x CVS -x 'bigdif*' ../wine.test/dlls/rpcrt4/rpc_binding.c ./dlls/rpcrt4/rpc_binding.c --- ../wine.test/dlls/rpcrt4/rpc_binding.c 2002-11-04 21:20:20.000000000 -0600 +++ ./dlls/rpcrt4/rpc_binding.c 2002-11-04 21:48:11.000000000 -0600 @@ -23,6 +23,7 @@ #include <stdio.h> #include <string.h> +#include <assert.h> #include "windef.h" #include "winbase.h" @@ -111,10 +112,10 @@ { RpcBinding* NewBinding; if (Binding) - TRACE(" (*Binding == ^%p, server == %s, Protseq == \"%s\")\n", *Binding, server ? "Yes" : "No", debugstr_w(Protseq)); + TRACE("(*Binding == ^%p, server == %s, Protseq == \"%s\")\n", *Binding, server ? "Yes" : "No", debugstr_w(Protseq)); else { ERR("!RpcBinding?\n"); - *((char *)0) = 0; /* we will crash below anyhow... */ + assert(FALSE); /* we will crash below anyhow... */ } NewBinding = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RpcBinding)); @@ -131,7 +132,7 @@ RPC_STATUS RPCRT4_CompleteBindingA(RpcBinding* Binding, LPSTR NetworkAddr, LPSTR Endpoint, LPSTR NetworkOptions) { - TRACE(" (RpcBinding == ^%p, NetworkAddr == \"%s\", EndPoint == \"%s\", NetworkOptions == \"%s\")\n", Binding, NetworkAddr, Endpoint, NetworkOptions); + TRACE("(RpcBinding == ^%p, NetworkAddr == \"%s\", EndPoint == \"%s\", NetworkOptions == \"%s\")\n", Binding, NetworkAddr, Endpoint, NetworkOptions); RPCRT4_strfree(Binding->NetworkAddr); Binding->NetworkAddr = RPCRT4_strdupA(NetworkAddr); @@ -148,7 +149,7 @@ RPC_STATUS RPCRT4_CompleteBindingW(RpcBinding* Binding, LPWSTR NetworkAddr, LPWSTR Endpoint, LPWSTR NetworkOptions) { - TRACE(" (RpcBinding == ^%p, NetworkAddr == \"%s\", EndPoint == \"%s\", NetworkOptions == \"%s\")\n", Binding, + TRACE("(RpcBinding == ^%p, NetworkAddr == \"%s\", EndPoint == \"%s\", NetworkOptions == \"%s\")\n", Binding, debugstr_w(NetworkAddr), debugstr_w(Endpoint), debugstr_w(NetworkOptions)); RPCRT4_strfree(Binding->NetworkAddr); @@ -173,7 +174,7 @@ RPC_STATUS RPCRT4_SetBindingObject(RpcBinding* Binding, UUID* ObjectUuid) { - TRACE(" (*RpcBinding == ^%p, UUID == %s)\n", Binding, debugstr_guid(ObjectUuid)); + TRACE("(*RpcBinding == ^%p, UUID == %s)\n", Binding, debugstr_guid(ObjectUuid)); if (ObjectUuid) memcpy(&Binding->ObjectUuid, ObjectUuid, sizeof(UUID)); else UuidCreateNil(&Binding->ObjectUuid); return RPC_S_OK; @@ -183,7 +184,7 @@ { RpcBinding* NewBinding; if (Binding) - TRACE(" (*RpcBinding == ^%p, OldBinding == ^%p)\n", *Binding, OldBinding); + TRACE("(*RpcBinding == ^%p, OldBinding == ^%p)\n", *Binding, OldBinding); else { ERR("!RpcBinding?"); /* we will crash below anyhow... */ @@ -355,7 +356,7 @@ RPC_STATUS RPCRT4_CloseBinding(RpcBinding* Binding) { - TRACE(" (Binding == ^%p)\n", Binding); + TRACE("(Binding == ^%p)\n", Binding); if (Binding->conn) { CancelIo(Binding->conn); CloseHandle(Binding->conn); diff -ur -x CVS -x 'bigdif*' ../wine.test/dlls/rpcrt4/rpcrt4_main.c ./dlls/rpcrt4/rpcrt4_main.c --- ../wine.test/dlls/rpcrt4/rpcrt4_main.c 2002-11-04 21:30:27.000000000 -0600 +++ ./dlls/rpcrt4/rpcrt4_main.c 2002-11-04 21:48:19.000000000 -0600 @@ -29,11 +29,7 @@ * right now. * * - The server portions of the patch don't seem to be getting accepted by - * Alexandre. My guess is that once I have a working test he'll conceed to - * let this in. To implement this properly is tricky and possibly beyond my - * abilities; Ove seems to think the right way to do this is to use LPC - * (Local Procedure Call, another undocumented monster). LPC has no implementation - * in wine and is not going to be trivial to create. + * Alexandre. Instead, we are working on "rpcss.exe.so" which will replace them. * * - There are several different memory allocation schemes for MSRPC. * I don't even understand what they all are yet, much less have them @@ -51,7 +47,7 @@ * up the code with conditionals like we do now. * * - Data marshalling: So far, only the very beginnings of an implementation - * exist in wine. NDR protocol is mostly documented, but the MS API's to + * exist in wine. NDR protocol itself is documented, but the MS API's to * convert data-types in memory into NDR are not. * * - ORPC is RPC for OLE; once we have a working RPC framework, we can @@ -63,7 +59,6 @@ * * - In-source API Documentation, at least for those functions which we have * implemented, but preferably for everything we can document, would be nice. - * I started out being quite good about this, and ended up getting lazy. * Some stuff is undocumented by Microsoft and we are guessing how to implement * (in these cases we should document the behavior we implemented, or, if there * is no implementation, at least hazard some kind of guess, and put a few @@ -77,9 +72,9 @@ * * - Concurrency: right now I don't think (?) we handle more than one request at a time; * we are supposed to be able to do this, and to queue requests which exceed the - * concurrency limit. + * concurrency limit. Lots of scenarios are untested. * - * - Protocol Towers: Totally unimplemented. I don't even know what these are. + * - Protocol Towers: Totally unimplemented.... I think. * * - Context Handle Rundown: whatever that is. * @@ -88,6 +83,8 @@ * - Statistics: we are supposed to be keeping various counters. we aren't. * * - Connectionless RPC: unimplemented. + * + * - XML RPC: Dunno if microsoft does it... but we'd might as well just for kicks. * * - ...? More stuff I haven't thought of. If you think of more RPC todo's drop me * an e-mail <gmturner007@ameritech.net> or send a patch to wine-patches. @@ -501,6 +498,8 @@ short c0 = 0, c1 = 0, x, y; int i; + if (!uuid) data = (BYTE*)(uuid = &uuid_nil); + TRACE("(%s)\n", debugstr_guid(uuid)); for (i=0; i<sizeof(UUID); i++) { @@ -538,6 +537,8 @@ if(!(*StringUuid)) return RPC_S_OUT_OF_MEMORY; + if (!Uuid) Uuid = &uuid_nil; + sprintf(*StringUuid, "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", Uuid->Data1, Uuid->Data2, Uuid->Data3, Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2], @@ -559,6 +560,8 @@ { char buf[37]; + if (!Uuid) Uuid = &uuid_nil; + sprintf(buf, "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", Uuid->Data1, Uuid->Data2, Uuid->Data3, Uuid->Data4[0], Uuid->Data4[1], Uuid->Data4[2], diff -ur -x CVS -x 'bigdif*' ../wine.test/tools/winapi/win32.api ./tools/winapi/win32.api --- ../wine.test/tools/winapi/win32.api 2002-11-04 21:13:59.000000000 -0600 +++ ./tools/winapi/win32.api 2002-11-04 21:48:15.000000000 -0600 @@ -2058,9 +2058,11 @@ PMIDL_STUB_MESSAGE * PMIDL_STUB_MESSAGE PPSFACTORYBUFFER +PRPC_BINDING_VECTOR PRPC_MESSAGE PRPC_POLICY PRPCOLEMESSAGE +PUUID_VECTOR ProxyFileInfo ** REFCLSID REFIID