[kernel32] add unittests for registry keys of serial ports

Alexandre Julliard julliard at winehq.org
Tue Apr 21 09:19:04 CDT 2009


Stefan Leichter <Stefan.Leichter at camline.com> writes:

> +    RegOpenKeyA(HKEY_LOCAL_MACHINE, "Hardware\\Description\\System", &desc_sys);
> +    RegOpenKeyA(HKEY_LOCAL_MACHINE, "Hardware\\Devicemap\\Serialcomm", &sercom);
> +    RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion\\Ports", &sw_ports);

You need to check for failure and handle it properly. I doubt you'll be
able to open these keys on Win9x for instance.

> +    result = RegOpenKeyA(HKEY_LOCAL_MACHINE, "System\\Select", &sub_key1);
> +    if(ERROR_SUCCESS == result) {
> +        size = sizeof(count1);
> +        result = RegQueryValueExA( sub_key1, "Current", NULL, NULL, (LPBYTE) &count1, &size);
> +        RegCloseKey(sub_key1);
> +    }
> +    if(ERROR_SUCCESS == result) {
> +        sprintf(sub_key1_name, "System\\ControlSet%03d\\Enum\\ACPI", count1);
> +        RegOpenKeyA(HKEY_LOCAL_MACHINE, sub_key1_name, &acpi);
> +    }

Do you really have an app that accesses ControlSetxxx directly?
CurrentControlSet is a lot easier to work with.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list