Author: akhaldi Date: Sat Nov 21 09:22:06 2015 New Revision: 69973
URL: http://svn.reactos.org/svn/reactos?rev=69973&view=rev Log: [NTDSAPI_WINETEST] Sync with Wine Staging 1.7.55. CORE-10536
Modified: trunk/rostests/winetests/ntdsapi/ntdsapi.c
Modified: trunk/rostests/winetests/ntdsapi/ntdsapi.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdsapi/ntdsapi.... ============================================================================== --- trunk/rostests/winetests/ntdsapi/ntdsapi.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ntdsapi/ntdsapi.c [iso-8859-1] Sat Nov 21 09:22:06 2015 @@ -84,7 +84,38 @@ ok(spn_length == lstrlenW(wszSpn5) + 1, "DsMakeSpnW should have returned spn_length of %d instead of %d\n", lstrlenW(wszSpn5) + 1, spn_length); }
+static void test_DsClientMakeSpnForTargetServer(void) +{ + static const WCHAR classW[] = {'c','l','a','s','s',0}; + static const WCHAR hostW[] = {'h','o','s','t','.','d','o','m','a','i','n',0}; + static const WCHAR resultW[] = {'c','l','a','s','s','/','h','o','s','t','.','d','o','m','a','i','n',0}; + DWORD ret, len; + WCHAR buf[256]; + + ret = DsClientMakeSpnForTargetServerW( NULL, NULL, NULL, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = DsClientMakeSpnForTargetServerW( classW, NULL, NULL, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + ret = DsClientMakeSpnForTargetServerW( classW, hostW, NULL, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + len = 0; + ret = DsClientMakeSpnForTargetServerW( classW, hostW, &len, NULL ); + ok( ret == ERROR_BUFFER_OVERFLOW, "got %u\n", ret ); + ok( len == lstrlenW(resultW) + 1, "got %u\n", len ); + + len = sizeof(buf)/sizeof(buf[0]); + buf[0] = 0; + ret = DsClientMakeSpnForTargetServerW( classW, hostW, &len, buf ); + ok( ret == ERROR_SUCCESS, "got %u\n", ret ); + ok( len == lstrlenW(resultW) + 1, "got %u\n", len ); + ok( !lstrcmpW( buf, resultW ), "wrong data\n" ); +} + START_TEST( ntdsapi ) { test_DsMakeSpn(); + test_DsClientMakeSpnForTargetServer(); }