Commit 48be9c6e authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard

Fix definitions for Uuid{To,From}String, RpcStringFree.

parent e25ab1fa
...@@ -160,7 +160,7 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll, ...@@ -160,7 +160,7 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll,
HKEY key, subkey; HKEY key, subkey;
TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid)); 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 */ /* register interfaces to point to clsid */
while (*pProxyFileList) { while (*pProxyFileList) {
...@@ -172,9 +172,9 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll, ...@@ -172,9 +172,9 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll,
TRACE("registering %s %s => %s\n", name, debugstr_guid(proxy->header.piid), clsid); 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); snprintf(keyname, sizeof(keyname), "Interface\\%s", iid);
RpcStringFreeA(&iid); RpcStringFreeA((unsigned char**)&iid);
if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0, if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0,
KEY_WRITE, NULL, &key, NULL) == ERROR_SUCCESS) { KEY_WRITE, NULL, &key, NULL) == ERROR_SUCCESS) {
if (name) if (name)
...@@ -205,7 +205,7 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll, ...@@ -205,7 +205,7 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll,
} }
/* done */ /* done */
RpcStringFreeA(&clsid); RpcStringFreeA((unsigned char**)&clsid);
return S_OK; return S_OK;
} }
...@@ -220,7 +220,7 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll, ...@@ -220,7 +220,7 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll,
char keyname[120], module[120]; char keyname[120], module[120];
TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid)); TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid));
UuidToStringA((UUID*)pclsid, &clsid); UuidToStringA((UUID*)pclsid, (unsigned char**)&clsid);
/* unregister interfaces */ /* unregister interfaces */
while (*pProxyFileList) { while (*pProxyFileList) {
...@@ -232,9 +232,9 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll, ...@@ -232,9 +232,9 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll,
TRACE("unregistering %s %s <= %s\n", name, debugstr_guid(proxy->header.piid), clsid); 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); snprintf(keyname, sizeof(keyname), "Interface\\%s", iid);
RpcStringFreeA(&iid); RpcStringFreeA((unsigned char**)&iid);
RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname); RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname);
} }
pProxyFileList++; pProxyFileList++;
...@@ -247,6 +247,6 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll, ...@@ -247,6 +247,6 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll,
RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname); RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname);
/* done */ /* done */
RpcStringFreeA(&clsid); RpcStringFreeA((unsigned char**)&clsid);
return S_OK; return S_OK;
} }
...@@ -595,11 +595,11 @@ RPC_STATUS WINAPI RpcStringBindingParseA( LPSTR StringBinding, LPSTR *ObjUuid, ...@@ -595,11 +595,11 @@ RPC_STATUS WINAPI RpcStringBindingParseA( LPSTR StringBinding, LPSTR *ObjUuid,
return RPC_S_OK; return RPC_S_OK;
fail: fail:
if (ObjUuid) RpcStringFreeA(ObjUuid); if (ObjUuid) RpcStringFreeA((unsigned char**)ObjUuid);
if (Protseq) RpcStringFreeA(Protseq); if (Protseq) RpcStringFreeA((unsigned char**)Protseq);
if (NetworkAddr) RpcStringFreeA(NetworkAddr); if (NetworkAddr) RpcStringFreeA((unsigned char**)NetworkAddr);
if (Endpoint) RpcStringFreeA(Endpoint); if (Endpoint) RpcStringFreeA((unsigned char**)Endpoint);
if (Options) RpcStringFreeA(Options); if (Options) RpcStringFreeA((unsigned char**)Options);
return RPC_S_INVALID_STRING_BINDING; return RPC_S_INVALID_STRING_BINDING;
} }
...@@ -771,11 +771,11 @@ RPC_STATUS WINAPI RpcBindingFromStringBindingA( LPSTR StringBinding, RPC_BINDING ...@@ -771,11 +771,11 @@ RPC_STATUS WINAPI RpcBindingFromStringBindingA( LPSTR StringBinding, RPC_BINDING
if (ret == RPC_S_OK) if (ret == RPC_S_OK)
ret = RPCRT4_CompleteBindingA(bind, NetworkAddr, Endpoint, Options); ret = RPCRT4_CompleteBindingA(bind, NetworkAddr, Endpoint, Options);
RpcStringFreeA(&Options); RpcStringFreeA((unsigned char**)&Options);
RpcStringFreeA(&Endpoint); RpcStringFreeA((unsigned char**)&Endpoint);
RpcStringFreeA(&NetworkAddr); RpcStringFreeA((unsigned char**)&NetworkAddr);
RpcStringFreeA(&Protseq); RpcStringFreeA((unsigned char**)&Protseq);
RpcStringFreeA(&ObjectUuid); RpcStringFreeA((unsigned char**)&ObjectUuid);
if (ret == RPC_S_OK) if (ret == RPC_S_OK)
*Binding = (RPC_BINDING_HANDLE)bind; *Binding = (RPC_BINDING_HANDLE)bind;
...@@ -835,13 +835,13 @@ RPC_STATUS WINAPI RpcBindingToStringBindingA( RPC_BINDING_HANDLE Binding, LPSTR* ...@@ -835,13 +835,13 @@ RPC_STATUS WINAPI RpcBindingToStringBindingA( RPC_BINDING_HANDLE Binding, LPSTR*
TRACE("(%p,%p)\n", Binding, StringBinding); 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; if (ret != RPC_S_OK) return ret;
ret = RpcStringBindingComposeA(ObjectUuid, bind->Protseq, bind->NetworkAddr, ret = RpcStringBindingComposeA(ObjectUuid, bind->Protseq, bind->NetworkAddr,
bind->Endpoint, NULL, StringBinding); bind->Endpoint, NULL, StringBinding);
RpcStringFreeA(&ObjectUuid); RpcStringFreeA((unsigned char**)&ObjectUuid);
return ret; return ret;
} }
...@@ -856,7 +856,7 @@ RPC_STATUS WINAPI RpcBindingToStringBindingW( RPC_BINDING_HANDLE Binding, LPWSTR ...@@ -856,7 +856,7 @@ RPC_STATUS WINAPI RpcBindingToStringBindingW( RPC_BINDING_HANDLE Binding, LPWSTR
TRACE("(%p,%p)\n", Binding, StringBinding); TRACE("(%p,%p)\n", Binding, StringBinding);
ret = RpcBindingToStringBindingA(Binding, &str); ret = RpcBindingToStringBindingA(Binding, &str);
*StringBinding = RPCRT4_strdupAtoW(str); *StringBinding = RPCRT4_strdupAtoW(str);
RpcStringFreeA(&str); RpcStringFreeA((unsigned char**)&str);
return ret; return ret;
} }
......
...@@ -190,7 +190,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) ...@@ -190,7 +190,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
* *
* S_OK if successful. * S_OK if successful.
*/ */
RPC_STATUS WINAPI RpcStringFreeA(LPSTR* String) RPC_STATUS WINAPI RpcStringFreeA(unsigned char** String)
{ {
HeapFree( GetProcessHeap(), 0, *String); HeapFree( GetProcessHeap(), 0, *String);
...@@ -206,7 +206,7 @@ RPC_STATUS WINAPI RpcStringFreeA(LPSTR* String) ...@@ -206,7 +206,7 @@ RPC_STATUS WINAPI RpcStringFreeA(LPSTR* String)
* *
* S_OK if successful. * S_OK if successful.
*/ */
RPC_STATUS WINAPI RpcStringFreeW(LPWSTR* String) RPC_STATUS WINAPI RpcStringFreeW(unsigned short** String)
{ {
HeapFree( GetProcessHeap(), 0, *String); HeapFree( GetProcessHeap(), 0, *String);
...@@ -545,7 +545,7 @@ unsigned short WINAPI UuidHash(UUID *uuid, RPC_STATUS *Status) ...@@ -545,7 +545,7 @@ unsigned short WINAPI UuidHash(UUID *uuid, RPC_STATUS *Status)
* S_OK if successful. * S_OK if successful.
* S_OUT_OF_MEMORY if unsucessful. * 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); *StringUuid = HeapAlloc( GetProcessHeap(), 0, sizeof(char) * 37);
...@@ -571,7 +571,7 @@ RPC_STATUS WINAPI UuidToStringA(UUID *Uuid, LPSTR* StringUuid) ...@@ -571,7 +571,7 @@ RPC_STATUS WINAPI UuidToStringA(UUID *Uuid, LPSTR* StringUuid)
* S_OK if successful. * S_OK if successful.
* S_OUT_OF_MEMORY if unsucessful. * 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]; char buf[37];
...@@ -605,7 +605,7 @@ static const BYTE hex2bin[] = ...@@ -605,7 +605,7 @@ static const BYTE hex2bin[] =
/*********************************************************************** /***********************************************************************
* UuidFromStringA (RPCRT4.@) * UuidFromStringA (RPCRT4.@)
*/ */
RPC_STATUS WINAPI UuidFromStringA(LPSTR str, UUID *uuid) RPC_STATUS WINAPI UuidFromStringA(unsigned char* str, UUID *uuid)
{ {
BYTE *s = (BYTE *)str; BYTE *s = (BYTE *)str;
int i; int i;
...@@ -646,7 +646,7 @@ RPC_STATUS WINAPI UuidFromStringA(LPSTR str, UUID *uuid) ...@@ -646,7 +646,7 @@ RPC_STATUS WINAPI UuidFromStringA(LPSTR str, UUID *uuid)
/*********************************************************************** /***********************************************************************
* UuidFromStringW (RPCRT4.@) * UuidFromStringW (RPCRT4.@)
*/ */
RPC_STATUS WINAPI UuidFromStringW(LPWSTR s, UUID *uuid) RPC_STATUS WINAPI UuidFromStringW(unsigned short* s, UUID *uuid)
{ {
int i; int i;
......
...@@ -86,7 +86,7 @@ void UuidConversionAndComparison(void) { ...@@ -86,7 +86,7 @@ void UuidConversionAndComparison(void) {
/* Uuid to String to Uuid (char) */ /* Uuid to String to Uuid (char) */
for (i1 = 0; i1 < 10; i1++) { for (i1 = 0; i1 < 10; i1++) {
Uuid1 = Uuid_Table[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( (UuidFromStringA(str, &Uuid2) == RPC_S_OK), "Simple String->UUID copy from generated UUID String" );
ok( UuidEqual(&Uuid1, &Uuid2, &rslt), "Uuid -> String -> Uuid transform" ); ok( UuidEqual(&Uuid1, &Uuid2, &rslt), "Uuid -> String -> Uuid transform" );
/* invalid uuid tests -- size of valid UUID string=36 */ /* invalid uuid tests -- size of valid UUID string=36 */
......
...@@ -250,21 +250,21 @@ RPCRTAPI RPC_STATUS RPC_ENTRY ...@@ -250,21 +250,21 @@ RPCRTAPI RPC_STATUS RPC_ENTRY
#define RpcStringBindingCompose WINELIB_NAME_AW(RpcStringBindingCompose) #define RpcStringBindingCompose WINELIB_NAME_AW(RpcStringBindingCompose)
RPCRTAPI RPC_STATUS RPC_ENTRY RPCRTAPI RPC_STATUS RPC_ENTRY
RpcStringFreeA(LPSTR* String); RpcStringFreeA(unsigned char** String);
RPCRTAPI RPC_STATUS RPC_ENTRY RPCRTAPI RPC_STATUS RPC_ENTRY
RpcStringFreeW(LPWSTR* String); RpcStringFreeW(unsigned short** String);
#define RpcStringFree WINELIB_NAME_AW(RpcStringFree) #define RpcStringFree WINELIB_NAME_AW(RpcStringFree)
RPCRTAPI RPC_STATUS RPC_ENTRY RPCRTAPI RPC_STATUS RPC_ENTRY
UuidToStringA( UUID* Uuid, LPSTR* StringUuid ); UuidToStringA( UUID* Uuid, unsigned char** StringUuid );
RPCRTAPI RPC_STATUS RPC_ENTRY RPCRTAPI RPC_STATUS RPC_ENTRY
UuidToStringW( UUID* Uuid, LPWSTR* StringUuid ); UuidToStringW( UUID* Uuid, unsigned short** StringUuid );
#define UuidToString WINELIB_NAME_AW(UuidToString) #define UuidToString WINELIB_NAME_AW(UuidToString)
RPCRTAPI RPC_STATUS RPC_ENTRY RPCRTAPI RPC_STATUS RPC_ENTRY
UuidFromStringA( LPSTR StringUuid, UUID* Uuid ); UuidFromStringA( unsigned char* StringUuid, UUID* Uuid );
RPCRTAPI RPC_STATUS RPC_ENTRY RPCRTAPI RPC_STATUS RPC_ENTRY
UuidFromStringW( LPWSTR StringUuid, UUID* Uuid ); UuidFromStringW( unsigned short* StringUuid, UUID* Uuid );
#define UuidFromString WINELIB_NAME_AW(UuidFromString) #define UuidFromString WINELIB_NAME_AW(UuidFromString)
RPCRTAPI RPC_STATUS RPC_ENTRY RPCRTAPI RPC_STATUS RPC_ENTRY
......
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