Commit 2e7353dc authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

iphlpapi: Implement ConvertStringToGuidW().

parent 8f12e295
......@@ -32,7 +32,7 @@
#@ stub ConvertRemoteInterfaceLuidToGuid
#@ stub ConvertRemoteInterfaceLuidToIndex
#@ stub ConvertStringToGuidA
#@ stub ConvertStringToGuidW
@ stdcall ConvertStringToGuidW( ptr ptr )
#@ stub ConvertStringToInterfacePhysicalAddress
#@ stub CPNatfwtCreateProviderInstance
#@ stub CPNatfwtDeregisterProviderInstance
......
......@@ -97,6 +97,14 @@ DWORD WINAPI ConvertGuidToStringW( const GUID *guid, WCHAR *str, DWORD len )
return ERROR_SUCCESS;
}
DWORD WINAPI ConvertStringToGuidW( const WCHAR *str, GUID *guid )
{
UNICODE_STRING ustr;
RtlInitUnicodeString( &ustr, str );
return RtlNtStatusToDosError( RtlGUIDFromString( &ustr, guid ) );
}
/******************************************************************
* AddIPAddress (IPHLPAPI.@)
*
......
......@@ -69,6 +69,7 @@ static DWORD (WINAPI *pCancelMibChangeNotify2)(HANDLE);
DWORD WINAPI ConvertGuidToStringA( const GUID *, char *, DWORD );
DWORD WINAPI ConvertGuidToStringW( const GUID *, WCHAR *, DWORD );
DWORD WINAPI ConvertStringToGuidW( const WCHAR *, GUID * );
static void loadIPHlpApi(void)
{
......@@ -2339,7 +2340,7 @@ static void test_ConvertGuidToString( void )
DWORD err;
char bufA[39];
WCHAR bufW[39];
GUID guid = { 0xa, 0xb, 0xc, { 0xd, 0, 0xe, 0xf } };
GUID guid = { 0xa, 0xb, 0xc, { 0xd, 0, 0xe, 0xf } }, guid2;
err = ConvertGuidToStringA( &guid, bufA, 38 );
ok( err, "got %d\n", err );
......@@ -2352,6 +2353,13 @@ static void test_ConvertGuidToString( void )
err = ConvertGuidToStringW( &guid, bufW, 39 );
ok( !err, "got %d\n", err );
ok( !wcscmp( bufW, L"{0000000A-000B-000C-0D00-0E0F00000000}" ), "got %s\n", debugstr_w( bufW ) );
err = ConvertStringToGuidW( bufW, &guid2 );
ok( !err, "got %d\n", err );
ok( IsEqualGUID( &guid, &guid2 ), "guid mismatch\n" );
err = ConvertStringToGuidW( L"foo", &guid2 );
ok( err == ERROR_INVALID_PARAMETER, "got %d\n", err );
}
START_TEST(iphlpapi)
......
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