From: Jactry Zeng jzeng@codeweavers.com
--- dlls/atl/registrar.c | 2 +- dlls/atl/tests/registrar.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/atl/registrar.c b/dlls/atl/registrar.c index 9009cd1c7cf..59023944147 100644 --- a/dlls/atl/registrar.c +++ b/dlls/atl/registrar.c @@ -280,7 +280,7 @@ static HRESULT do_process_key(LPCOLESTR *pstr, HKEY parent_key, strbuf *buf, BOO hres = get_word(&iter, buf); if(FAILED(hres)) break; - dw = wcstol(buf->str, NULL, 10); + dw = wcstoul(buf->str, NULL, 10); lres = RegSetValueExW(hkey, name.len ? name.str : NULL, 0, REG_DWORD, (PBYTE)&dw, sizeof(dw)); if(lres != ERROR_SUCCESS) { diff --git a/dlls/atl/tests/registrar.c b/dlls/atl/tests/registrar.c index f6b9d422cb5..38e6dc9d3f9 100644 --- a/dlls/atl/tests/registrar.c +++ b/dlls/atl/tests/registrar.c @@ -49,6 +49,10 @@ static const char textA[] = " val 'dword_unquoted_dec' = d 1 \n" " val 'dword_quoted_hex' = d '0xA' \n" " val 'dword_unquoted_hex' = d 0xA \n" +" val 'dword_negative' = d -2147483648 \n" +" val 'dword_ulong' = d 2147483649 \n" +" val 'dword_max' = d 4294967295 \n" +" val 'dword_overrange' = d 4294967296 \n" " val 'binary_quoted' = b 'deadbeef' \n" " val 'binary_unquoted' = b dead0123 \n" " } \n" @@ -72,6 +76,10 @@ static void test_registrar(void) { "dword_quoted_dec", TRUE, 1 }, { "dword_quoted_hex", FALSE, 0xA }, { "dword_unquoted_hex", FALSE, 0xA }, + { "dword_negative", FALSE, -2147483648 }, + { "dword_ulong", TRUE, 2147483649 }, + { "dword_max", TRUE, 4294967295 }, + { "dword_overrange", FALSE, 4294967296 }, };
if (!GetProcAddress(GetModuleHandleA("atl.dll"), "AtlAxAttachControl"))