ADVAPI/tests: fix two failures, complement with two tests
Saulius Krasuckas
saulius2 at ar.fi.lt
Fri Nov 4 04:06:33 CST 2005
Log message:
Saulius Krasuckas <saulius.krasuckas at ieee.org>
- RegConnectRegistryA fails on Win9x when Remote Registry Service
is not installed. (WinReg.DLL is missing)
- Test "\\" prefixed computer names too.
Index: dlls/advapi32/tests/registry.c
===================================================================
RCS file: /home/wine/wine/dlls/advapi32/tests/registry.c,v
retrieving revision 1.33
diff -p -u -r1.33 registry.c
--- dlls/advapi32/tests/registry.c 27 Oct 2005 18:29:07 -0000 1.33
+++ dlls/advapi32/tests/registry.c 4 Nov 2005 08:42:25 -0000
@@ -601,24 +601,41 @@ static BOOL set_privileges(LPCSTR privil
static void test_regconnectregistry( void)
{
CHAR compName[MAX_COMPUTERNAME_LENGTH + 1];
+ CHAR netwName[MAX_COMPUTERNAME_LENGTH + 3]; /* 2 chars for double backslash */
DWORD len = sizeof(compName) ;
BOOL ret;
LONG retl;
HKEY hkey;
SC_HANDLE schnd;
+ DWORD GLE;
ret = GetComputerNameA(compName, &len);
ok( ret, "GetComputerName failed err = %ld\n", GetLastError());
if( !ret) return;
+ lstrcpyA(netwName, "\\\\");
+ lstrcpynA(netwName+2, compName, MAX_COMPUTERNAME_LENGTH + 1);
+
retl = RegConnectRegistryA( compName, HKEY_LOCAL_MACHINE, &hkey);
- ok( !retl, "RegConnectRegistryA failed err = %ld\n", retl);
+ ok( !retl || retl == ERROR_DLL_INIT_FAILED, "RegConnectRegistryA failed err = %ld\n", retl);
if( !retl) RegCloseKey( hkey);
- schnd = OpenSCManagerA( compName, NULL, GENERIC_READ);
- ok( schnd != NULL, "OpenSCManagerA failed err = %ld\n", GetLastError());
- CloseServiceHandle( schnd);
+ retl = RegConnectRegistryA( netwName, HKEY_LOCAL_MACHINE, &hkey);
+ ok( !retl || retl == ERROR_DLL_INIT_FAILED, "RegConnectRegistryA failed err = %ld\n", retl);
+ if( !retl) RegCloseKey( hkey);
+ schnd = OpenSCManagerA( compName, NULL, GENERIC_READ);
+ GLE = GetLastError();
+ ok( schnd != NULL || GLE==ERROR_CALL_NOT_IMPLEMENTED,
+ "OpenSCManagerA failed err = %ld\n", GLE);
+ CloseServiceHandle( schnd);
+
+ schnd = OpenSCManagerA( netwName, NULL, GENERIC_READ);
+ GLE = GetLastError();
+ ok( schnd != NULL || GLE==ERROR_CALL_NOT_IMPLEMENTED,
+ "OpenSCManagerA failed err = %ld\n", GLE);
+ CloseServiceHandle( schnd);
+
}
START_TEST(registry)
More information about the wine-patches
mailing list