Commit 1b1b6c5f authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

kernelbase: Use wide-char string literals.

parent 40d4fbe4
...@@ -2944,7 +2944,7 @@ HRESULT WINAPI UrlUnescapeW(WCHAR *url, WCHAR *unescaped, DWORD *unescaped_len, ...@@ -2944,7 +2944,7 @@ HRESULT WINAPI UrlUnescapeW(WCHAR *url, WCHAR *unescaped, DWORD *unescaped_len,
else if (*src == '%' && isxdigit(*(src + 1)) && isxdigit(*(src + 2)) && !stop_unescaping) else if (*src == '%' && isxdigit(*(src + 1)) && isxdigit(*(src + 2)) && !stop_unescaping)
{ {
INT ih; INT ih;
WCHAR buf[5] = {'0','x',0}; WCHAR buf[5] = L"0x";
memcpy(buf + 2, src + 1, 2*sizeof(WCHAR)); memcpy(buf + 2, src + 1, 2*sizeof(WCHAR));
buf[4] = 0; buf[4] = 0;
StrToIntExW(buf, STIF_SUPPORT_HEX, &ih); StrToIntExW(buf, STIF_SUPPORT_HEX, &ih);
......
...@@ -2775,7 +2775,6 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer ...@@ -2775,7 +2775,6 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer
/* Parse the value and load the string. */ /* Parse the value and load the string. */
{ {
WCHAR *pComma = wcsrchr(pwszExpandedBuffer, ','), *pNewBuffer; WCHAR *pComma = wcsrchr(pwszExpandedBuffer, ','), *pNewBuffer;
const WCHAR backslashW[] = {'\\',0};
UINT uiStringId; UINT uiStringId;
DWORD baseDirLen; DWORD baseDirLen;
int reqChars; int reqChars;
...@@ -2802,7 +2801,7 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer ...@@ -2802,7 +2801,7 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer
if (baseDirLen) { if (baseDirLen) {
lstrcpyW(pwszTempBuffer, pwszBaseDir); lstrcpyW(pwszTempBuffer, pwszBaseDir);
if (pwszBaseDir[baseDirLen - 1] != '\\') if (pwszBaseDir[baseDirLen - 1] != '\\')
lstrcatW(pwszTempBuffer, backslashW); lstrcatW(pwszTempBuffer, L"\\");
} }
lstrcatW(pwszTempBuffer, pwszExpandedBuffer + 1); lstrcatW(pwszTempBuffer, pwszExpandedBuffer + 1);
......
...@@ -546,9 +546,9 @@ static void test_PathAllocCombine(void) ...@@ -546,9 +546,9 @@ static void test_PathAllocCombine(void)
static void test_PathCchCombine(void) static void test_PathCchCombine(void)
{ {
WCHAR expected[PATHCCH_MAX_CCH] = {'C', ':', '\\', 'a', 0}; WCHAR expected[PATHCCH_MAX_CCH] = L"C:\\a";
WCHAR p1[PATHCCH_MAX_CCH] = {'C', ':', '\\', 0}; WCHAR p1[PATHCCH_MAX_CCH] = L"C:\\";
WCHAR p2[PATHCCH_MAX_CCH] = {'a', 0}; WCHAR p2[PATHCCH_MAX_CCH] = L"a";
WCHAR output[PATHCCH_MAX_CCH]; WCHAR output[PATHCCH_MAX_CCH];
HRESULT hr; HRESULT hr;
INT i; INT i;
...@@ -607,9 +607,9 @@ static void test_PathCchCombine(void) ...@@ -607,9 +607,9 @@ static void test_PathCchCombine(void)
static void test_PathCchCombineEx(void) static void test_PathCchCombineEx(void)
{ {
WCHAR expected[MAX_PATH] = {'C',':','\\','a',0}; WCHAR expected[MAX_PATH] = L"C:\\a";
WCHAR p1[MAX_PATH] = {'C',':','\\',0}; WCHAR p1[MAX_PATH] = L"C:\\";
WCHAR p2[MAX_PATH] = {'a',0}; WCHAR p2[MAX_PATH] = L"a";
WCHAR output[MAX_PATH]; WCHAR output[MAX_PATH];
HRESULT hr; HRESULT hr;
int i; int i;
......
...@@ -152,7 +152,6 @@ static DWORD get_mountmgr_drive_type( LPCWSTR root ) ...@@ -152,7 +152,6 @@ static DWORD get_mountmgr_drive_type( LPCWSTR root )
/* get the label by reading it from a file at the root of the filesystem */ /* get the label by reading it from a file at the root of the filesystem */
static void get_filesystem_label( const UNICODE_STRING *device, WCHAR *label, DWORD len ) static void get_filesystem_label( const UNICODE_STRING *device, WCHAR *label, DWORD len )
{ {
static const WCHAR labelW[] = {'.','w','i','n','d','o','w','s','-','l','a','b','e','l',0};
HANDLE handle; HANDLE handle;
UNICODE_STRING name; UNICODE_STRING name;
IO_STATUS_BLOCK io; IO_STATUS_BLOCK io;
...@@ -167,12 +166,12 @@ static void get_filesystem_label( const UNICODE_STRING *device, WCHAR *label, DW ...@@ -167,12 +166,12 @@ static void get_filesystem_label( const UNICODE_STRING *device, WCHAR *label, DW
attr.SecurityDescriptor = NULL; attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL; attr.SecurityQualityOfService = NULL;
name.MaximumLength = device->Length + sizeof(labelW); name.MaximumLength = device->Length + sizeof(L".windows-label");
name.Length = name.MaximumLength - sizeof(WCHAR); name.Length = name.MaximumLength - sizeof(WCHAR);
if (!(name.Buffer = HeapAlloc( GetProcessHeap(), 0, name.MaximumLength ))) return; if (!(name.Buffer = HeapAlloc( GetProcessHeap(), 0, name.MaximumLength ))) return;
memcpy( name.Buffer, device->Buffer, device->Length ); memcpy( name.Buffer, device->Buffer, device->Length );
memcpy( name.Buffer + device->Length / sizeof(WCHAR), labelW, sizeof(labelW) ); memcpy( name.Buffer + device->Length / sizeof(WCHAR), L".windows-label", sizeof(L".windows-label") );
if (!NtOpenFile( &handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ|FILE_SHARE_WRITE, if (!NtOpenFile( &handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ|FILE_SHARE_WRITE,
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT )) FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT ))
{ {
...@@ -193,7 +192,6 @@ static void get_filesystem_label( const UNICODE_STRING *device, WCHAR *label, DW ...@@ -193,7 +192,6 @@ static void get_filesystem_label( const UNICODE_STRING *device, WCHAR *label, DW
/* get the serial number by reading it from a file at the root of the filesystem */ /* get the serial number by reading it from a file at the root of the filesystem */
static DWORD get_filesystem_serial( const UNICODE_STRING *device ) static DWORD get_filesystem_serial( const UNICODE_STRING *device )
{ {
static const WCHAR serialW[] = {'.','w','i','n','d','o','w','s','-','s','e','r','i','a','l',0};
HANDLE handle; HANDLE handle;
UNICODE_STRING name; UNICODE_STRING name;
IO_STATUS_BLOCK io; IO_STATUS_BLOCK io;
...@@ -207,12 +205,12 @@ static DWORD get_filesystem_serial( const UNICODE_STRING *device ) ...@@ -207,12 +205,12 @@ static DWORD get_filesystem_serial( const UNICODE_STRING *device )
attr.SecurityDescriptor = NULL; attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL; attr.SecurityQualityOfService = NULL;
name.MaximumLength = device->Length + sizeof(serialW); name.MaximumLength = device->Length + sizeof(L".windows-serial");
name.Length = name.MaximumLength - sizeof(WCHAR); name.Length = name.MaximumLength - sizeof(WCHAR);
if (!(name.Buffer = HeapAlloc( GetProcessHeap(), 0, name.MaximumLength ))) return 0; if (!(name.Buffer = HeapAlloc( GetProcessHeap(), 0, name.MaximumLength ))) return 0;
memcpy( name.Buffer, device->Buffer, device->Length ); memcpy( name.Buffer, device->Buffer, device->Length );
memcpy( name.Buffer + device->Length / sizeof(WCHAR), serialW, sizeof(serialW) ); memcpy( name.Buffer + device->Length / sizeof(WCHAR), L".windows-serial", sizeof(L".windows-serial") );
if (!NtOpenFile( &handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ|FILE_SHARE_WRITE, if (!NtOpenFile( &handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ|FILE_SHARE_WRITE,
FILE_SYNCHRONOUS_IO_NONALERT )) FILE_SYNCHRONOUS_IO_NONALERT ))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment