Author: akhaldi
Date: Tue Nov 22 13:13:22 2016
New Revision: 73344
URL:
http://svn.reactos.org/svn/reactos?rev=73344&view=rev
Log:
[RPCRT4_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409
Modified:
trunk/rostests/winetests/rpcrt4/CMakeLists.txt
trunk/rostests/winetests/rpcrt4/cstub.c
trunk/rostests/winetests/rpcrt4/ndr_marshall.c
trunk/rostests/winetests/rpcrt4/rpc.c
trunk/rostests/winetests/rpcrt4/server.c
Modified: trunk/rostests/winetests/rpcrt4/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/CMakeLis…
==============================================================================
--- trunk/rostests/winetests/rpcrt4/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/winetests/rpcrt4/CMakeLists.txt [iso-8859-1] Tue Nov 22 13:13:22 2016
@@ -28,7 +28,7 @@
add_executable(rpcrt4_winetest ${SOURCE})
target_link_libraries(rpcrt4_winetest uuid wine ${PSEH_LIB})
set_module_type(rpcrt4_winetest win32cui)
-add_importlibs(rpcrt4_winetest ole32 rpcrt4 msvcrt kernel32 ntdll)
+add_importlibs(rpcrt4_winetest ole32 rpcrt4 secur32 msvcrt kernel32 ntdll)
add_cd_file(TARGET rpcrt4_winetest DESTINATION reactos/bin FOR all)
if(NOT MSVC)
Modified: trunk/rostests/winetests/rpcrt4/cstub.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/cstub.c?…
==============================================================================
--- trunk/rostests/winetests/rpcrt4/cstub.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/rpcrt4/cstub.c [iso-8859-1] Tue Nov 22 13:13:22 2016
@@ -44,6 +44,7 @@
static GUID IID_if2 = {0x12345679, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}};
static GUID IID_if3 = {0x1234567a, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}};
static GUID IID_if4 = {0x1234567b, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}};
+static CLSID CLSID_psfact = {0x1234567c, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}};
static int my_alloc_called;
static int my_free_called;
@@ -458,7 +459,6 @@
IPSFactoryBuffer *ppsf = NULL;
const PCInterfaceProxyVtblList* proxy_vtbl;
const PCInterfaceStubVtblList* stub_vtbl;
- const CLSID PSDispatch = {0x20420, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46}};
const CLSID CLSID_Unknown = {0x45678, 0x1234, 0x6666, {0xff, 0x67, 0x45, 0x98, 0x76,
0x12, 0x34, 0x56}};
static const GUID * const interfaces[] = { &IID_if1, &IID_if2, &IID_if3,
&IID_if4 };
UINT i;
@@ -475,13 +475,13 @@
void *CStd_DebugServerQueryInterface = GetProcAddress(hmod,
"CStdStubBuffer_DebugServerQueryInterface");
void *CStd_DebugServerRelease = GetProcAddress(hmod,
"CStdStubBuffer_DebugServerRelease");
- r = NdrDllGetClassObject(&PSDispatch, &IID_IPSFactoryBuffer,
(void**)&ppsf, proxy_file_list,
- &CLSID_Unknown, &PSFactoryBuffer);
+ r = NdrDllGetClassObject(&CLSID_Unknown, &IID_IPSFactoryBuffer,
(void**)&ppsf, proxy_file_list,
+ &CLSID_psfact, &PSFactoryBuffer);
ok(r == CLASS_E_CLASSNOTAVAILABLE, "NdrDllGetClassObject with unknown clsid
should have returned CLASS_E_CLASSNOTAVAILABLE instead of 0x%x\n", r);
ok(ppsf == NULL, "NdrDllGetClassObject should have set ppsf to NULL on
failure\n");
- r = NdrDllGetClassObject(&PSDispatch, &IID_IPSFactoryBuffer,
(void**)&ppsf, proxy_file_list,
- &PSDispatch, &PSFactoryBuffer);
+ r = NdrDllGetClassObject(&CLSID_psfact, &IID_IPSFactoryBuffer,
(void**)&ppsf, proxy_file_list,
+ &CLSID_psfact, &PSFactoryBuffer);
ok(r == S_OK, "ret %08x\n", r);
ok(ppsf != NULL, "ppsf == NULL\n");
@@ -603,10 +603,42 @@
ok(PSFactoryBuffer.RefCount == 1, "ref count %d\n",
PSFactoryBuffer.RefCount);
IPSFactoryBuffer_Release(ppsf);
+ /* One can also search by IID */
+ r = NdrDllGetClassObject(&IID_if3, &IID_IPSFactoryBuffer, (void**)&ppsf,
proxy_file_list,
+ &CLSID_psfact, &PSFactoryBuffer);
+ ok(r == S_OK, "ret %08x\n", r);
+ ok(ppsf != NULL, "ppsf == NULL\n");
+ IPSFactoryBuffer_Release(ppsf);
+
r = NdrDllGetClassObject(&IID_if3, &IID_IPSFactoryBuffer, (void**)&ppsf,
proxy_file_list,
NULL, &PSFactoryBuffer);
ok(r == S_OK, "ret %08x\n", r);
ok(ppsf != NULL, "ppsf == NULL\n");
+ IPSFactoryBuffer_Release(ppsf);
+
+ /* but only if the PS factory implements it */
+ r = NdrDllGetClassObject(&IID_IDispatch, &IID_IPSFactoryBuffer,
(void**)&ppsf, proxy_file_list,
+ &CLSID_psfact, &PSFactoryBuffer);
+ ok(r == CLASS_E_CLASSNOTAVAILABLE, "ret %08x\n", r);
+
+ /* Create it again to return */
+ r = NdrDllGetClassObject(&CLSID_psfact, &IID_IPSFactoryBuffer,
(void**)&ppsf, proxy_file_list,
+ &CLSID_psfact, &PSFactoryBuffer);
+ ok(r == S_OK, "ret %08x\n", r);
+ ok(ppsf != NULL, "ppsf == NULL\n");
+
+ /* Because this PS factory is not loaded as a dll in the normal way, Windows 8 / 10
+ get confused and will crash when one of the proxies for the delegated ifaces is
created.
+ Registering the ifaces fixes this (in fact calling CoRegisterPSClsid() with any
IID / CLSID is enough). */
+
+ r = CoRegisterPSClsid(&IID_if1, &CLSID_psfact);
+ ok(r == S_OK, "ret %08x\n", r);
+ r = CoRegisterPSClsid(&IID_if2, &CLSID_psfact);
+ ok(r == S_OK, "ret %08x\n", r);
+ r = CoRegisterPSClsid(&IID_if3, &CLSID_psfact);
+ ok(r == S_OK, "ret %08x\n", r);
+ r = CoRegisterPSClsid(&IID_if4, &CLSID_psfact);
+ ok(r == S_OK, "ret %08x\n", r);
return ppsf;
}
Modified: trunk/rostests/winetests/rpcrt4/ndr_marshall.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/ndr_mars…
==============================================================================
--- trunk/rostests/winetests/rpcrt4/ndr_marshall.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/rpcrt4/ndr_marshall.c [iso-8859-1] Tue Nov 22 13:13:22 2016
@@ -2433,11 +2433,9 @@
status = MesEncodeFixedBufferHandleCreate(buffer, 0, &encoded_size,
&handle);
todo_wine
ok(status == RPC_S_INVALID_ARG, "got %d\n", status);
-if (status == RPC_S_OK)
-{
+if (status == RPC_S_OK) {
MesHandleFree(handle);
}
-
status = MesEncodeFixedBufferHandleCreate(buffer, 32, NULL, &handle);
ok(status == RPC_S_INVALID_ARG, "got %d\n", status);
Modified: trunk/rostests/winetests/rpcrt4/rpc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/rpc.c?re…
==============================================================================
--- trunk/rostests/winetests/rpcrt4/rpc.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/rpcrt4/rpc.c [iso-8859-1] Tue Nov 22 13:13:22 2016
@@ -429,13 +429,10 @@
RPC_STATUS rpc_status;
BOOL w2k3_up = FALSE;
- /* Windows 2003 and Vista return STATUS_UNSUCCESSFUL if given an unknown status */
+ /* Windows 2003 and above return STATUS_UNSUCCESSFUL if given an unknown status */
win32status = I_RpcMapWin32Status(9999);
if (win32status == STATUS_UNSUCCESSFUL)
- {
- trace("We are on Windows 2003 or Vista\n");
w2k3_up = TRUE;
- }
/* On Windows XP-SP1 and below some statuses are not mapped and return
* the given status
@@ -810,7 +807,7 @@
/* If the call succeeded, there's a valid (non-multicast) MAC
* address in the uuid:
*/
- ok(!(guid1.Data4[2] & 0x01),
+ ok(!(guid1.Data4[2] & 0x01) || broken(guid1.Data4[2] & 0x01), /* Win
8.1 */
"GUID does not appear to contain a MAC address: %s\n",
wine_dbgstr_guid(&guid1));
}
@@ -860,19 +857,12 @@
{
RPC_STATUS ret;
RPC_CSTR principal, saved_principal;
- BOOLEAN (WINAPI *pGetUserNameExA)(EXTENDED_NAME_FORMAT,LPSTR,PULONG);
char *username;
ULONG len = 0;
- pGetUserNameExA = (void *)GetProcAddress( LoadLibraryA("secur32.dll"),
"GetUserNameExA" );
- if (!pGetUserNameExA)
- {
- win_skip( "GetUserNameExA not exported\n" );
- return;
- }
- pGetUserNameExA( NameSamCompatible, NULL, &len );
+ GetUserNameExA( NameSamCompatible, NULL, &len );
username = HeapAlloc( GetProcessHeap(), 0, len );
- pGetUserNameExA( NameSamCompatible, username, &len );
+ GetUserNameExA( NameSamCompatible, username, &len );
ret = RpcServerInqDefaultPrincNameA( 0, NULL );
ok( ret == RPC_S_UNKNOWN_AUTHN_SERVICE, "got %u\n", ret );
Modified: trunk/rostests/winetests/rpcrt4/server.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/server.c…
==============================================================================
--- trunk/rostests/winetests/rpcrt4/server.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/rpcrt4/server.c [iso-8859-1] Tue Nov 22 13:13:22 2016
@@ -43,7 +43,6 @@
static NDR_SCONTEXT (WINAPI *pNDRSContextUnmarshall2)(RPC_BINDING_HANDLE, void*, ULONG,
void*, ULONG);
static RPC_STATUS (WINAPI *pRpcServerRegisterIfEx)(RPC_IF_HANDLE,UUID*, RPC_MGR_EPV*,
unsigned int,
unsigned int,RPC_IF_CALLBACK_FN*);
-static BOOLEAN (WINAPI *pGetUserNameExA)(EXTENDED_NAME_FORMAT, LPSTR, PULONG);
static RPC_STATUS (WINAPI *pRpcBindingSetAuthInfoExA)(RPC_BINDING_HANDLE, RPC_CSTR,
ULONG, ULONG,
RPC_AUTH_IDENTITY_HANDLE, ULONG,
RPC_SECURITY_QOS *);
static RPC_STATUS (WINAPI *pRpcServerRegisterAuthInfoA)(RPC_CSTR, ULONG,
RPC_AUTH_KEY_RETRIEVAL_FN, LPVOID);
@@ -59,14 +58,12 @@
static void InitFunctionPointers(void)
{
HMODULE hrpcrt4 = GetModuleHandleA("rpcrt4.dll");
- HMODULE hsecur32 = LoadLibraryA("secur32.dll");
pNDRSContextMarshall2 = (void *)GetProcAddress(hrpcrt4,
"NDRSContextMarshall2");
pNDRSContextUnmarshall2 = (void *)GetProcAddress(hrpcrt4,
"NDRSContextUnmarshall2");
pRpcServerRegisterIfEx = (void *)GetProcAddress(hrpcrt4,
"RpcServerRegisterIfEx");
pRpcBindingSetAuthInfoExA = (void *)GetProcAddress(hrpcrt4,
"RpcBindingSetAuthInfoExA");
pRpcServerRegisterAuthInfoA = (void *)GetProcAddress(hrpcrt4,
"RpcServerRegisterAuthInfoA");
- pGetUserNameExA = (void *)GetProcAddress(hsecur32, "GetUserNameExA");
if (!pNDRSContextMarshall2) old_windows_version = TRUE;
}
@@ -1019,8 +1016,11 @@
if (!old_windows_version)
{
+ re = 0xdeadbeef;
get_ranged_enum(&re);
- ok(re == RE3, "get_ranged_enum() returned %d instead of RE3\n", re);
+ ok(re == RE3 ||
+ broken(re == MAKELONG(re, 0xdead)), /* Win 8, Win 10 */
+ "get_ranged_enum() returned %x instead of RE3\n", re);
}
}
@@ -1510,7 +1510,7 @@
todo_wine
ok(principal != NULL, "NULL principal\n");
}
- if (protseq == RPC_PROTSEQ_LRPC && principal && pGetUserNameExA)
+ if (protseq == RPC_PROTSEQ_LRPC && principal)
{
int len;
char *spn;
@@ -1558,9 +1558,6 @@
RPC_STATUS status;
RPC_SECURITY_QOS qos;
- if (!pGetUserNameExA)
- return;
-
qos.Version = 1;
qos.Capabilities = RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH;
qos.IdentityTracking = RPC_C_QOS_IDENTITY_STATIC;
@@ -1719,11 +1716,9 @@
if (ncalrpc_status == RPC_S_OK)
{
run_client("ncalrpc_basic");
- if (pGetUserNameExA)
- {
- /* we don't need to register RPC_C_AUTHN_WINNT for ncalrpc */
- run_client("ncalrpc_secure");
- }
+
+ /* we don't need to register RPC_C_AUTHN_WINNT for ncalrpc */
+ run_client("ncalrpc_secure");
}
else
skip("lrpc tests skipped due to earlier failure\n");
@@ -1752,20 +1747,15 @@
START_TEST(server)
{
+ ULONG size = 0;
int argc;
char **argv;
InitFunctionPointers();
- if (pGetUserNameExA)
- {
- ULONG size = 0;
- ok(!pGetUserNameExA(NameSamCompatible, NULL, &size),
"GetUserNameExA\n");
- domain_and_user = HeapAlloc(GetProcessHeap(), 0, size);
- ok(pGetUserNameExA(NameSamCompatible, domain_and_user, &size),
"GetUserNameExA\n");
- }
- else
- win_skip("GetUserNameExA is needed for some authentication tests\n");
+ ok(!GetUserNameExA(NameSamCompatible, NULL, &size), "GetUserNameExA\n");
+ domain_and_user = HeapAlloc(GetProcessHeap(), 0, size);
+ ok(GetUserNameExA(NameSamCompatible, domain_and_user, &size),
"GetUserNameExA\n");
argc = winetest_get_mainargs(&argv);
progname = argv[0];