From: Vijay Kiran Kamuju infyquest@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52208 --- dlls/ws2_32/protocol.c | 20 ++++++++++++++++++ dlls/ws2_32/tests/protocol.c | 41 ++++++++++++++++++++++++++++++++++++ dlls/ws2_32/ws2_32.spec | 1 + include/ws2spi.h | 1 + 4 files changed, 63 insertions(+)
diff --git a/dlls/ws2_32/protocol.c b/dlls/ws2_32/protocol.c index c19f8430d98..0b123136988 100644 --- a/dlls/ws2_32/protocol.c +++ b/dlls/ws2_32/protocol.c @@ -2190,6 +2190,26 @@ int WINAPI WSCEnableNSProvider( GUID *provider, BOOL enable ) }
+/*********************************************************************** + * WSCGetApplicationCategory (ws2_32.@) + */ +int WINAPI WSCGetApplicationCategory( const WCHAR *path, DWORD path_len, const WCHAR *extra, + DWORD extra_len, DWORD *category, int *errcode ) +{ + FIXME( "(%s %lu %s %lu %p %p) Stub!\n", + debugstr_w(path), path_len, debugstr_w(extra), extra_len, category, errcode ); + + if (!path) + { + *errcode = WSAEINVAL; + return -1; + } + + *errcode = WSANO_RECOVERY; + return -1; +} + + /*********************************************************************** * WSCGetProviderInfo (ws2_32.@) */ diff --git a/dlls/ws2_32/tests/protocol.c b/dlls/ws2_32/tests/protocol.c index e1a431a3e32..2bacd7221ce 100644 --- a/dlls/ws2_32/tests/protocol.c +++ b/dlls/ws2_32/tests/protocol.c @@ -43,6 +43,7 @@ static const char *(WINAPI *p_inet_ntop)(int family, void *addr, char *string, U static const WCHAR *(WINAPI *pInetNtopW)(int family, void *addr, WCHAR *string, ULONG size); static int (WINAPI *p_inet_pton)(int family, const char *string, void *addr); static int (WINAPI *pInetPtonW)(int family, WCHAR *string, void *addr); +static int (WINAPI *pWSCGetApplicationCategory)(LPCWSTR path, DWORD path_len, LPCWSTR extra, DWORD extra_len, DWORD *category, INT *err); static int (WINAPI *pWSCGetProviderInfo)(GUID *provider, WSC_PROVIDER_INFO_TYPE type, BYTE *info, size_t *size, DWORD flags, INT *err);
/* TCP and UDP over IP fixed set of service flags */ @@ -2874,6 +2875,44 @@ static void test_WSAEnumNameSpaceProvidersW(void) free(name); }
+static void test_WSCGetApplicationCategory(void) +{ + int ret; + int errcode; + DWORD category; + + if (!pWSCGetApplicationCategory) + { + win_skip("WSCGetApplicationCategory is not available.\n"); + return; + } + + errcode = 0xdeadbeef; + ret = pWSCGetApplicationCategory(NULL, 0, NULL, 0, NULL, &errcode); + ok(ret == SOCKET_ERROR, "got %d, expected SOCKET_ERROR\n", ret); + ok(errcode == WSAEINVAL, "got %d, expected WSAEINVAL\n", errcode); + + errcode = 0xdeadbeef; + ret = pWSCGetApplicationCategory(L"", 0, NULL, 0, NULL, &errcode); + ok(ret == SOCKET_ERROR, "got %d, expected SOCKET_ERROR\n", ret); + todo_wine ok(errcode == WSAEINVAL, "got %d, expected WSAEINVAL\n", errcode); + + errcode = 0xdeadbeef; + ret = pWSCGetApplicationCategory(L"", 0, L"", 0, NULL, &errcode); + ok(ret == SOCKET_ERROR, "got %d, expected SOCKET_ERROR\n", ret); + todo_wine ok(errcode == WSAEINVAL, "got %d, expected WSAEINVAL\n", errcode); + + errcode = 0xdeadbeef; + ret = pWSCGetApplicationCategory(L"", 0, NULL, 0, &category, &errcode); + ok(ret == SOCKET_ERROR, "got %d, expected SOCKET_ERROR\n", ret); + todo_wine ok(errcode == WSAEINVAL, "got %d, expected WSAEINVAL\n", errcode); + + errcode = 0xdeadbeef; + ret = pWSCGetApplicationCategory(L"", 0, L"", 0, &category, &errcode); + ok(ret == SOCKET_ERROR, "got %d, expected SOCKET_ERROR\n", ret); + todo_wine ok(errcode == WSAEINVAL, "got %d, expected WSAEINVAL\n", errcode); +} + static void test_WSCGetProviderInfo(void) { int ret; @@ -3054,6 +3093,7 @@ START_TEST( protocol ) pInetNtopW = (void *)GetProcAddress(GetModuleHandleA("ws2_32"), "InetNtopW"); p_inet_pton = (void *)GetProcAddress(GetModuleHandleA("ws2_32"), "inet_pton"); pInetPtonW = (void *)GetProcAddress(GetModuleHandleA("ws2_32"), "InetPtonW"); + pWSCGetApplicationCategory = (void *)GetProcAddress(GetModuleHandleA("ws2_32"), "WSCGetApplicationCategory"); pWSCGetProviderInfo = (void *)GetProcAddress(GetModuleHandleA("ws2_32"), "WSCGetProviderInfo");
ret = WSAStartup(0x202, &data); @@ -3086,6 +3126,7 @@ START_TEST( protocol )
test_WSAEnumNameSpaceProvidersA(); test_WSAEnumNameSpaceProvidersW(); + test_WSCGetApplicationCategory(); test_WSCGetProviderInfo(); test_WSCGetProviderPath();
diff --git a/dlls/ws2_32/ws2_32.spec b/dlls/ws2_32/ws2_32.spec index 3266a239f9c..0fded68ff76 100644 --- a/dlls/ws2_32/ws2_32.spec +++ b/dlls/ws2_32/ws2_32.spec @@ -121,6 +121,7 @@ @ stdcall WSCDeinstallProvider(ptr ptr) @ stdcall WSCEnableNSProvider(ptr long) @ stdcall WSCEnumProtocols(ptr ptr ptr ptr) +@ stdcall WSCGetApplicationCategory(wstr long wstr long ptr ptr) @ stdcall WSCGetProviderInfo(ptr long ptr ptr long ptr) @ stdcall WSCGetProviderPath(ptr ptr ptr ptr) @ stdcall WSCInstallNameSpace(wstr wstr long long ptr) diff --git a/include/ws2spi.h b/include/ws2spi.h index a399afe6f2c..7e214a091b2 100644 --- a/include/ws2spi.h +++ b/include/ws2spi.h @@ -45,6 +45,7 @@ INT WINAPI WSCInstallProvider(const LPGUID,LPCWSTR,const LPWSAPROTOCOL_INFO INT WINAPI WSCDeinstallProvider(LPGUID,LPINT); INT WINAPI WSCEnableNSProvider(LPGUID,BOOL); INT WINAPI WSCEnumProtocols(LPINT,LPWSAPROTOCOL_INFOW,LPDWORD,LPINT); +INT WINAPI WSCGetApplicationCategory(LPCWSTR,DWORD,LPCWSTR,DWORD,DWORD*,LPINT); INT WINAPI WSCGetProviderInfo(LPGUID,WSC_PROVIDER_INFO_TYPE,PBYTE,size_t*,DWORD,LPINT); INT WINAPI WSCGetProviderPath(LPGUID,LPWSTR,LPINT,LPINT); INT WINAPI WSCInstallNameSpace(LPWSTR,LPWSTR,DWORD,DWORD,LPGUID);