From 0edd7dacb4990046c5940cda7df5d34c34ca159e Mon Sep 17 00:00:00 2001 From: Rafal Harabien Date: Sun, 18 Dec 2011 22:37:47 +0000 Subject: [PATCH] [ATL] - Fix processing of binary data in registrar scripts svn path=/trunk/; revision=54686 --- reactos/lib/atl/statreg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/lib/atl/statreg.h b/reactos/lib/atl/statreg.h index 895ac82bc3b..33e784cbbc3 100644 --- a/reactos/lib/atl/statreg.h +++ b/reactos/lib/atl/statreg.h @@ -473,7 +473,7 @@ private: inline unsigned int HexToBin(char a) { if (a >= '0' && a <= '9') - return a - 0x30; + return a - '0'; if (a >= 'A' && a <= 'F') return a - 'A' + 10; if (a >= 'a' && a <= 'f') @@ -630,7 +630,7 @@ private: return DISP_E_EXCEPTION; count = count / 2; for (curIndex = 0; curIndex < count; curIndex++) - buf->str[curIndex] = (HexToBin(buf->str[curIndex * 2]) << 4) | HexToBin(buf->str[curIndex * 2 + 1]); + ((BYTE*)buf->str)[curIndex] = (HexToBin(buf->str[curIndex * 2]) << 4) | HexToBin(buf->str[curIndex * 2 + 1]); lres = RegSetValueEx(hkey, name.len ? name.str : NULL, 0, REG_BINARY, (PBYTE)buf->str, count); if (lres != ERROR_SUCCESS) hres = HRESULT_FROM_WIN32(lres);