- Remove an unneeded header inclusion;
- Fix a sizeof invocation;
- RegEnumKeyExW and RegEnumValueW take their fourth parameter (size of key / value name, resp.) as a size in number of *characters* (and not in number of bytes);
- Add a missing RegCloseKey call in LocaleList_Create.
svn path=/trunk/; revision=74385
#ifndef _INPUT_H
#define _INPUT_H
-#include <stdarg.h>
+#include <stdlib.h>
+#include <wchar.h>
#define WIN32_NO_STATUS
#include <windef.h>
#include <commctrl.h>
#include <windowsx.h>
#include <setupapi.h>
-#include <wchar.h>
#include <strsafe.h>
-#include <stdlib.h>
#include "resource.h"
KEY_QUERY_VALUE,
&hKey) == ERROR_SUCCESS)
{
- DWORD dwSize;
-
- dwSize = sizeof(dwSize);
+ DWORD dwSize = sizeof(dwAttributes);
RegQueryValueExW(hKey,
L"Attributes",
return;
}
- dwSize = sizeof(szLayoutId);
+ dwSize = ARRAYSIZE(szLayoutId);
while (RegEnumKeyExW(hKey, dwIndex, szLayoutId, &dwSize,
NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
RegCloseKey(hLayoutKey);
}
- dwSize = sizeof(szLayoutId);
+ dwSize = ARRAYSIZE(szLayoutId);
++dwIndex;
}
return NULL;
}
- dwSize = sizeof(szValue);
+ dwSize = ARRAYSIZE(szValue);
dwIndex = 0;
while (RegEnumValueW(hKey, dwIndex, szValue, &dwSize,
LocaleList_Append(dwId, szName);
}
- dwSize = sizeof(szValue);
+ dwSize = ARRAYSIZE(szValue);
++dwIndex;
}
+ RegCloseKey(hKey);
+
return _LocaleList;
}