From 48be9c6e87ecee4212e2d0e36992bbeb37abed31 Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Tue, 24 Dec 2002 00:26:55 +0000 Subject: [PATCH] Fix definitions for Uuid{To,From}String, RpcStringFree. --- dlls/rpcrt4/cpsf.c | 16 ++++++++-------- dlls/rpcrt4/rpc_binding.c | 26 +++++++++++++------------- dlls/rpcrt4/rpcrt4_main.c | 12 ++++++------ dlls/rpcrt4/tests/rpc.c | 2 +- include/rpcdce.h | 12 ++++++------ 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/dlls/rpcrt4/cpsf.c b/dlls/rpcrt4/cpsf.c index 49930d913fe..d4c021e8cd3 100644 --- a/dlls/rpcrt4/cpsf.c +++ b/dlls/rpcrt4/cpsf.c @@ -160,7 +160,7 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll, HKEY key, subkey; TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid)); - UuidToStringA((UUID*)pclsid, &clsid); + UuidToStringA((UUID*)pclsid, (unsigned char**)&clsid); /* register interfaces to point to clsid */ while (*pProxyFileList) { @@ -172,9 +172,9 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll, TRACE("registering %s %s => %s\n", name, debugstr_guid(proxy->header.piid), clsid); - UuidToStringA((UUID*)proxy->header.piid, &iid); + UuidToStringA((UUID*)proxy->header.piid, (unsigned char**)&iid); snprintf(keyname, sizeof(keyname), "Interface\\%s", iid); - RpcStringFreeA(&iid); + RpcStringFreeA((unsigned char**)&iid); if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0, KEY_WRITE, NULL, &key, NULL) == ERROR_SUCCESS) { if (name) @@ -205,7 +205,7 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll, } /* done */ - RpcStringFreeA(&clsid); + RpcStringFreeA((unsigned char**)&clsid); return S_OK; } @@ -220,7 +220,7 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll, char keyname[120], module[120]; TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid)); - UuidToStringA((UUID*)pclsid, &clsid); + UuidToStringA((UUID*)pclsid, (unsigned char**)&clsid); /* unregister interfaces */ while (*pProxyFileList) { @@ -232,9 +232,9 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll, TRACE("unregistering %s %s <= %s\n", name, debugstr_guid(proxy->header.piid), clsid); - UuidToStringA((UUID*)proxy->header.piid, &iid); + UuidToStringA((UUID*)proxy->header.piid, (unsigned char**)&iid); snprintf(keyname, sizeof(keyname), "Interface\\%s", iid); - RpcStringFreeA(&iid); + RpcStringFreeA((unsigned char**)&iid); RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname); } pProxyFileList++; @@ -247,6 +247,6 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll, RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname); /* done */ - RpcStringFreeA(&clsid); + RpcStringFreeA((unsigned char**)&clsid); return S_OK; } diff --git a/dlls/rpcrt4/rpc_binding.c b/dlls/rpcrt4/rpc_binding.c index a6eb28f0280..01a070f25c7 100644 --- a/dlls/rpcrt4/rpc_binding.c +++ b/dlls/rpcrt4/rpc_binding.c @@ -595,11 +595,11 @@ RPC_STATUS WINAPI RpcStringBindingParseA( LPSTR StringBinding, LPSTR *ObjUuid, return RPC_S_OK; fail: - if (ObjUuid) RpcStringFreeA(ObjUuid); - if (Protseq) RpcStringFreeA(Protseq); - if (NetworkAddr) RpcStringFreeA(NetworkAddr); - if (Endpoint) RpcStringFreeA(Endpoint); - if (Options) RpcStringFreeA(Options); + if (ObjUuid) RpcStringFreeA((unsigned char**)ObjUuid); + if (Protseq) RpcStringFreeA((unsigned char**)Protseq); + if (NetworkAddr) RpcStringFreeA((unsigned char**)NetworkAddr); + if (Endpoint) RpcStringFreeA((unsigned char**)Endpoint); + if (Options) RpcStringFreeA((unsigned char**)Options); return RPC_S_INVALID_STRING_BINDING; } @@ -771,11 +771,11 @@ RPC_STATUS WINAPI RpcBindingFromStringBindingA( LPSTR StringBinding, RPC_BINDING if (ret == RPC_S_OK) ret = RPCRT4_CompleteBindingA(bind, NetworkAddr, Endpoint, Options); - RpcStringFreeA(&Options); - RpcStringFreeA(&Endpoint); - RpcStringFreeA(&NetworkAddr); - RpcStringFreeA(&Protseq); - RpcStringFreeA(&ObjectUuid); + RpcStringFreeA((unsigned char**)&Options); + RpcStringFreeA((unsigned char**)&Endpoint); + RpcStringFreeA((unsigned char**)&NetworkAddr); + RpcStringFreeA((unsigned char**)&Protseq); + RpcStringFreeA((unsigned char**)&ObjectUuid); if (ret == RPC_S_OK) *Binding = (RPC_BINDING_HANDLE)bind; @@ -835,13 +835,13 @@ RPC_STATUS WINAPI RpcBindingToStringBindingA( RPC_BINDING_HANDLE Binding, LPSTR* TRACE("(%p,%p)\n", Binding, StringBinding); - ret = UuidToStringA(&bind->ObjectUuid, &ObjectUuid); + ret = UuidToStringA(&bind->ObjectUuid, (unsigned char**)&ObjectUuid); if (ret != RPC_S_OK) return ret; ret = RpcStringBindingComposeA(ObjectUuid, bind->Protseq, bind->NetworkAddr, bind->Endpoint, NULL, StringBinding); - RpcStringFreeA(&ObjectUuid); + RpcStringFreeA((unsigned char**)&ObjectUuid); return ret; } @@ -856,7 +856,7 @@ RPC_STATUS WINAPI RpcBindingToStringBindingW( RPC_BINDING_HANDLE Binding, LPWSTR TRACE("(%p,%p)\n", Binding, StringBinding); ret = RpcBindingToStringBindingA(Binding, &str); *StringBinding = RPCRT4_strdupAtoW(str); - RpcStringFreeA(&str); + RpcStringFreeA((unsigned char**)&str); return ret; } diff --git a/dlls/rpcrt4/rpcrt4_main.c b/dlls/rpcrt4/rpcrt4_main.c index d718d3ba093..8e6b41faba0 100644 --- a/dlls/rpcrt4/rpcrt4_main.c +++ b/dlls/rpcrt4/rpcrt4_main.c @@ -190,7 +190,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) * * S_OK if successful. */ -RPC_STATUS WINAPI RpcStringFreeA(LPSTR* String) +RPC_STATUS WINAPI RpcStringFreeA(unsigned char** String) { HeapFree( GetProcessHeap(), 0, *String); @@ -206,7 +206,7 @@ RPC_STATUS WINAPI RpcStringFreeA(LPSTR* String) * * S_OK if successful. */ -RPC_STATUS WINAPI RpcStringFreeW(LPWSTR* String) +RPC_STATUS WINAPI RpcStringFreeW(unsigned short** String) { HeapFree( GetProcessHeap(), 0, *String); @@ -545,7 +545,7 @@ unsigned short WINAPI UuidHash(UUID *uuid, RPC_STATUS *Status) * S_OK if successful. * S_OUT_OF_MEMORY if unsucessful. */ -RPC_STATUS WINAPI UuidToStringA(UUID *Uuid, LPSTR* StringUuid) +RPC_STATUS WINAPI UuidToStringA(UUID *Uuid, unsigned char** StringUuid) { *StringUuid = HeapAlloc( GetProcessHeap(), 0, sizeof(char) * 37); @@ -571,7 +571,7 @@ RPC_STATUS WINAPI UuidToStringA(UUID *Uuid, LPSTR* StringUuid) * S_OK if successful. * S_OUT_OF_MEMORY if unsucessful. */ -RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, LPWSTR* StringUuid) +RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, unsigned short** StringUuid) { char buf[37]; @@ -605,7 +605,7 @@ static const BYTE hex2bin[] = /*********************************************************************** * UuidFromStringA (RPCRT4.@) */ -RPC_STATUS WINAPI UuidFromStringA(LPSTR str, UUID *uuid) +RPC_STATUS WINAPI UuidFromStringA(unsigned char* str, UUID *uuid) { BYTE *s = (BYTE *)str; int i; @@ -646,7 +646,7 @@ RPC_STATUS WINAPI UuidFromStringA(LPSTR str, UUID *uuid) /*********************************************************************** * UuidFromStringW (RPCRT4.@) */ -RPC_STATUS WINAPI UuidFromStringW(LPWSTR s, UUID *uuid) +RPC_STATUS WINAPI UuidFromStringW(unsigned short* s, UUID *uuid) { int i; diff --git a/dlls/rpcrt4/tests/rpc.c b/dlls/rpcrt4/tests/rpc.c index 7b4e45eb0b9..8b050b6ecda 100644 --- a/dlls/rpcrt4/tests/rpc.c +++ b/dlls/rpcrt4/tests/rpc.c @@ -86,7 +86,7 @@ void UuidConversionAndComparison(void) { /* Uuid to String to Uuid (char) */ for (i1 = 0; i1 < 10; i1++) { Uuid1 = Uuid_Table[i1]; - ok( (UuidToStringA(&Uuid1, &str) == RPC_S_OK), "Simple UUID->String copy" ); + ok( (UuidToStringA(&Uuid1, (unsigned char**)&str) == RPC_S_OK), "Simple UUID->String copy" ); ok( (UuidFromStringA(str, &Uuid2) == RPC_S_OK), "Simple String->UUID copy from generated UUID String" ); ok( UuidEqual(&Uuid1, &Uuid2, &rslt), "Uuid -> String -> Uuid transform" ); /* invalid uuid tests -- size of valid UUID string=36 */ diff --git a/include/rpcdce.h b/include/rpcdce.h index 8026023ae32..c0b4e55d308 100644 --- a/include/rpcdce.h +++ b/include/rpcdce.h @@ -250,21 +250,21 @@ RPCRTAPI RPC_STATUS RPC_ENTRY #define RpcStringBindingCompose WINELIB_NAME_AW(RpcStringBindingCompose) RPCRTAPI RPC_STATUS RPC_ENTRY - RpcStringFreeA(LPSTR* String); + RpcStringFreeA(unsigned char** String); RPCRTAPI RPC_STATUS RPC_ENTRY - RpcStringFreeW(LPWSTR* String); + RpcStringFreeW(unsigned short** String); #define RpcStringFree WINELIB_NAME_AW(RpcStringFree) RPCRTAPI RPC_STATUS RPC_ENTRY - UuidToStringA( UUID* Uuid, LPSTR* StringUuid ); + UuidToStringA( UUID* Uuid, unsigned char** StringUuid ); RPCRTAPI RPC_STATUS RPC_ENTRY - UuidToStringW( UUID* Uuid, LPWSTR* StringUuid ); + UuidToStringW( UUID* Uuid, unsigned short** StringUuid ); #define UuidToString WINELIB_NAME_AW(UuidToString) RPCRTAPI RPC_STATUS RPC_ENTRY - UuidFromStringA( LPSTR StringUuid, UUID* Uuid ); + UuidFromStringA( unsigned char* StringUuid, UUID* Uuid ); RPCRTAPI RPC_STATUS RPC_ENTRY - UuidFromStringW( LPWSTR StringUuid, UUID* Uuid ); + UuidFromStringW( unsigned short* StringUuid, UUID* Uuid ); #define UuidFromString WINELIB_NAME_AW(UuidFromString) RPCRTAPI RPC_STATUS RPC_ENTRY