[MSACM32] Sync with Wine Staging 4.0. CORE-15682
[reactos.git] / dll / win32 / msacm32 / internal.c
index 7bafcaa..aad071e 100644 (file)
@@ -72,7 +72,7 @@ PWINE_ACMDRIVERID MSACM_RegisterDriverFromRegistry(LPCWSTR pszRegEntry)
     /* The requested registry entry must have the format msacm.XXXXX in order to
        be recognized in any future sessions of msacm
      */
-    if (0 == strncmpiW(pszRegEntry, msacmW, sizeof(msacmW)/sizeof(WCHAR))) {
+    if (0 == strncmpiW(pszRegEntry, msacmW, ARRAY_SIZE(msacmW))) {
         lRet = RegOpenKeyExW(HKEY_LOCAL_MACHINE, drvkey, 0, KEY_QUERY_VALUE, &hKey);
         if (lRet != ERROR_SUCCESS) {
             WARN("unable to open registry key - 0x%08x\n", lRet);
@@ -373,31 +373,31 @@ void MSACM_RegisterAllDrivers(void)
     if (lRet == ERROR_SUCCESS) {
        RegQueryInfoKeyW( hKey, 0, 0, 0, &cnt, 0, 0, 0, 0, 0, 0, 0);
        for (i = 0; i < cnt; i++) {
-           bufLen = sizeof(buf) / sizeof(buf[0]);
+           bufLen = ARRAY_SIZE(buf);
            lRet = RegEnumKeyExW(hKey, i, buf, &bufLen, 0, 0, 0, &lastWrite);
            if (lRet != ERROR_SUCCESS) continue;
-           if (strncmpiW(buf, msacmW, sizeof(msacmW)/sizeof(msacmW[0]))) continue;
+           if (strncmpiW(buf, msacmW, ARRAY_SIZE(msacmW))) continue;
            if (!(name = strchrW(buf, '='))) continue;
            *name = 0;
            MSACM_RegisterDriver(buf, name + 1, 0);
        }
        i = 0;
-       cnt = sizeof(valname) / sizeof(*valname);
+       cnt = ARRAY_SIZE(valname);
        bufLen = sizeof(buf);
        while(RegEnumValueW(hKey, i, valname, &cnt, 0,
                    &type, (BYTE*)buf, &bufLen) == ERROR_SUCCESS){
-           if(!strncmpiW(valname, msacmW, sizeof(msacmW) / sizeof(*msacmW)))
+           if (!strncmpiW(valname, msacmW, ARRAY_SIZE(msacmW)))
                MSACM_RegisterDriver(valname, buf, 0);
            ++i;
        }
        RegCloseKey( hKey );
     }
 
-    if (GetPrivateProfileSectionW(drv32, buf, sizeof(buf)/sizeof(buf[0]), sys))
+    if (GetPrivateProfileSectionW(drv32, buf, ARRAY_SIZE(buf), sys))
     {
        for(s = buf; *s;  s += strlenW(s) + 1)
        {
-           if (strncmpiW(s, msacmW, sizeof(msacmW)/sizeof(msacmW[0]))) continue;
+           if (strncmpiW(s, msacmW, ARRAY_SIZE(msacmW))) continue;
            if (!(name = strchrW(s, '='))) continue;
            *name = 0;
            MSACM_RegisterDriver(s, name + 1, 0);