mirror of
https://github.com/reactos/reactos.git
synced 2025-05-21 10:05:35 +00:00
[RPCRT4] RpcStringFreeA/W must set the pointer to NULL
Add a matching wine test. This change will be sent upstream.
This commit is contained in:
parent
5ecb9e8cb5
commit
2a783979ff
2 changed files with 19 additions and 0 deletions
|
@ -158,6 +158,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||
RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR* String)
|
||||
{
|
||||
HeapFree( GetProcessHeap(), 0, *String);
|
||||
if (String) *String = NULL;
|
||||
|
||||
return RPC_S_OK;
|
||||
}
|
||||
|
@ -174,6 +175,7 @@ RPC_STATUS WINAPI RpcStringFreeA(RPC_CSTR* String)
|
|||
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR* String)
|
||||
{
|
||||
HeapFree( GetProcessHeap(), 0, *String);
|
||||
if (String) *String = NULL;
|
||||
|
||||
return RPC_S_OK;
|
||||
}
|
||||
|
|
|
@ -854,6 +854,22 @@ static void test_RpcBindingFree(void)
|
|||
status);
|
||||
}
|
||||
|
||||
static void test_RpcStringFree(void)
|
||||
{
|
||||
RPC_WSTR string = NULL;
|
||||
|
||||
string = HeapAlloc(GetProcessHeap(), 0, 10*sizeof(WCHAR));
|
||||
if (string == NULL)
|
||||
{
|
||||
skip("Failed to allocate a string!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
RpcStringFreeW(&string);
|
||||
|
||||
ok(string == NULL, "String is %p expected NULL!\n", string);
|
||||
}
|
||||
|
||||
static void test_RpcServerInqDefaultPrincName(void)
|
||||
{
|
||||
RPC_STATUS ret;
|
||||
|
@ -1204,6 +1220,7 @@ START_TEST( rpc )
|
|||
test_UuidCreate();
|
||||
test_UuidCreateSequential();
|
||||
test_RpcBindingFree();
|
||||
test_RpcStringFree();
|
||||
test_RpcServerInqDefaultPrincName();
|
||||
test_RpcServerRegisterAuthInfo();
|
||||
|
||||
|
|
Loading…
Reference in a new issue