Commit a243a7af authored by Alexandre Julliard's avatar Alexandre Julliard

winecfg: Use wide character string literals.

parent fe979931
......@@ -38,8 +38,6 @@ static HFONT titleFont = NULL;
INT_PTR CALLBACK
AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static const WCHAR openW[] = {'o','p','e','n',0};
static const WCHAR tahomaW[] = {'T','a','h','o','m','a',0};
const char * (CDECL *wine_get_version)(void);
HWND hWnd;
HDC hDC;
......@@ -73,7 +71,7 @@ AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
case NM_CLICK:
case NM_RETURN:
if(wParam == IDC_ABT_WEB_LINK)
ShellExecuteW(NULL, openW, ((NMLINK *)lParam)->item.szUrl, NULL, NULL, SW_SHOW);
ShellExecuteW(NULL, L"open", ((NMLINK *)lParam)->item.szUrl, NULL, NULL, SW_SHOW);
break;
}
break;
......@@ -109,7 +107,7 @@ AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* prepare the title text */
titleFont = CreateFontW( -MulDiv(24, GetDeviceCaps(hDC, LOGPIXELSY), 72),
0, 0, 0, 0, FALSE, 0, 0, 0, 0, 0, 0, 0, tahomaW );
0, 0, 0, 0, FALSE, 0, 0, 0, 0, 0, 0, 0, L"Tahoma" );
SendDlgItemMessageW(hDlg, IDC_ABT_TITLE_TEXT, WM_SETFONT, (WPARAM)titleFont, TRUE);
wine_get_version = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), "wine_get_version" );
......
......@@ -319,16 +319,14 @@ static BOOL list_contains_file(HWND listview, WCHAR *filename)
static void on_add_app_click(HWND dialog)
{
static const WCHAR filterW[] = {'%','s','%','c','*','.','e','x','e',';','*','.','e','x','e','.','s','o','%','c',0};
WCHAR filetitle[MAX_PATH];
WCHAR file[MAX_PATH];
WCHAR programsFilter[100], filter[MAX_PATH];
WCHAR selectExecutableStr[100];
static const WCHAR pathC[] = { 'c',':','\\',0 };
OPENFILENAMEW ofn = { sizeof(OPENFILENAMEW),
dialog, /*hInst*/0, 0, NULL, 0, 0, NULL,
0, NULL, 0, pathC, 0,
0, NULL, 0, L"C:\\", 0,
OFN_SHOWHELP | OFN_HIDEREADONLY | OFN_ENABLESIZING,
0, 0, NULL, 0, NULL };
......@@ -336,7 +334,7 @@ static void on_add_app_click(HWND dialog)
ARRAY_SIZE(selectExecutableStr));
LoadStringW (GetModuleHandleW(NULL), IDS_EXECUTABLE_FILTER, programsFilter,
ARRAY_SIZE(programsFilter));
swprintf( filter, MAX_PATH, filterW, programsFilter, 0, 0 );
swprintf( filter, MAX_PATH, L"%s%c*.exe;*.exe.so%c", programsFilter, 0, 0 );
ofn.lpstrTitle = selectExecutableStr;
ofn.lpstrFilter = filter;
......
......@@ -58,13 +58,7 @@ struct DeviceInfo {
int speaker_config;
};
static WCHAR g_drv_keyW[256] = {'S','o','f','t','w','a','r','e','\\',
'W','i','n','e','\\','D','r','i','v','e','r','s','\\',0};
static const WCHAR reg_out_nameW[] = {'D','e','f','a','u','l','t','O','u','t','p','u','t',0};
static const WCHAR reg_in_nameW[] = {'D','e','f','a','u','l','t','I','n','p','u','t',0};
static const WCHAR reg_vout_nameW[] = {'D','e','f','a','u','l','t','V','o','i','c','e','O','u','t','p','u','t',0};
static const WCHAR reg_vin_nameW[] = {'D','e','f','a','u','l','t','V','o','i','c','e','I','n','p','u','t',0};
static WCHAR g_drv_keyW[256] = L"Software\\Wine\\Drivers\\";
static UINT num_render_devs, num_capture_devs;
static struct DeviceInfo *render_devs, *capture_devs;
......@@ -192,10 +186,7 @@ static BOOL get_driver_name(IMMDeviceEnumerator *devenum, PROPVARIANT *pv)
IPropertyStore *ps;
HRESULT hr;
static const WCHAR wine_info_deviceW[] = {'W','i','n','e',' ',
'i','n','f','o',' ','d','e','v','i','c','e',0};
hr = IMMDeviceEnumerator_GetDevice(devenum, wine_info_deviceW, &device);
hr = IMMDeviceEnumerator_GetDevice(devenum, L"Wine info device", &device);
if(FAILED(hr))
return FALSE;
......@@ -300,10 +291,10 @@ static void initAudioDlg (HWND hDlg)
if(have_driver){
WCHAR *reg_out_dev, *reg_vout_dev, *reg_in_dev, *reg_vin_dev;
reg_out_dev = get_reg_keyW(HKEY_CURRENT_USER, g_drv_keyW, reg_out_nameW, NULL);
reg_vout_dev = get_reg_keyW(HKEY_CURRENT_USER, g_drv_keyW, reg_vout_nameW, NULL);
reg_in_dev = get_reg_keyW(HKEY_CURRENT_USER, g_drv_keyW, reg_in_nameW, NULL);
reg_vin_dev = get_reg_keyW(HKEY_CURRENT_USER, g_drv_keyW, reg_vin_nameW, NULL);
reg_out_dev = get_reg_keyW(HKEY_CURRENT_USER, g_drv_keyW, L"DefaultOutput", NULL);
reg_vout_dev = get_reg_keyW(HKEY_CURRENT_USER, g_drv_keyW, L"DefaultVoiceOutput", NULL);
reg_in_dev = get_reg_keyW(HKEY_CURRENT_USER, g_drv_keyW, L"DefaultInput", NULL);
reg_vin_dev = get_reg_keyW(HKEY_CURRENT_USER, g_drv_keyW, L"DefaultVoiceInput", NULL);
for(i = 0; i < num_render_devs; ++i){
LVITEMW lvitem;
......@@ -485,25 +476,25 @@ AudioDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
break;
case IDC_AUDIOOUT_DEVICE:
if(HIWORD(wParam) == CBN_SELCHANGE){
set_reg_device(hDlg, IDC_AUDIOOUT_DEVICE, reg_out_nameW);
set_reg_device(hDlg, IDC_AUDIOOUT_DEVICE, L"DefaultOutput");
SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
}
break;
case IDC_VOICEOUT_DEVICE:
if(HIWORD(wParam) == CBN_SELCHANGE){
set_reg_device(hDlg, IDC_VOICEOUT_DEVICE, reg_vout_nameW);
set_reg_device(hDlg, IDC_VOICEOUT_DEVICE, L"DefaultVoiceOutput");
SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
}
break;
case IDC_AUDIOIN_DEVICE:
if(HIWORD(wParam) == CBN_SELCHANGE){
set_reg_device(hDlg, IDC_AUDIOIN_DEVICE, reg_in_nameW);
set_reg_device(hDlg, IDC_AUDIOIN_DEVICE, L"DefaultInput");
SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
}
break;
case IDC_VOICEIN_DEVICE:
if(HIWORD(wParam) == CBN_SELCHANGE){
set_reg_device(hDlg, IDC_VOICEIN_DEVICE, reg_vin_nameW);
set_reg_device(hDlg, IDC_VOICEIN_DEVICE, L"DefaultVoiceInput");
SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
}
break;
......
......@@ -159,7 +159,7 @@ static DWORD get_drive_type( char letter )
static void set_drive_label( char letter, const WCHAR *label )
{
static const WCHAR emptyW[1];
WCHAR device[] = {'a',':','\\',0}; /* SetVolumeLabel() requires a trailing slash */
WCHAR device[] = L"a:\\"; /* SetVolumeLabel() requires a trailing slash */
device[0] = letter;
if (!label) label = emptyW;
......@@ -179,7 +179,7 @@ static void set_drive_label( char letter, const WCHAR *label )
/* set the drive serial number via a .windows-serial file */
static void set_drive_serial( WCHAR letter, DWORD serial )
{
WCHAR filename[] = {'a',':','\\','.','w','i','n','d','o','w','s','-','s','e','r','i','a','l',0};
WCHAR filename[] = L"a:\\.windows-serial";
HANDLE hFile;
filename[0] = letter;
......@@ -256,7 +256,7 @@ BOOL load_drives(void)
{
DWORD i, size = 1024;
HANDLE mgr;
WCHAR root[] = {'A',':','\\',0};
WCHAR root[] = L"A:\\";
if ((mgr = open_mountmgr()) == INVALID_HANDLE_VALUE) return FALSE;
......
......@@ -561,9 +561,7 @@ static void on_edit_changed(HWND dialog, WORD id)
BOOL browse_for_unix_folder(HWND dialog, WCHAR *pszPath)
{
static WCHAR wszUnixRootDisplayName[] =
{ ':',':','{','C','C','7','0','2','E','B','2','-','7','D','C','5','-','1','1','D','9','-',
'C','6','8','7','-','0','0','0','4','2','3','8','A','0','1','C','D','}', 0 };
static WCHAR wszUnixRootDisplayName[] = L"::{CC702EB2-7DC5-11D9-C687-0004238A01CD}";
WCHAR pszChoosePath[FILENAME_MAX];
BROWSEINFOW bi = {
dialog,
......
......@@ -230,17 +230,14 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrev, LPSTR szCmdLine, int nShow)
if (IsWow64Process( GetCurrentProcess(), &is_wow64 ) && is_wow64)
{
static const WCHAR winecfgW[] = {'\\','w','i','n','e','c','f','g','.','e','x','e',0};
STARTUPINFOW si;
PROCESS_INFORMATION pi;
WCHAR filename[MAX_PATH];
WCHAR filename[] = L"C:\\windows\\system32\\winecfg.exe";
void *redir;
DWORD exit_code;
memset( &si, 0, sizeof(si) );
si.cb = sizeof(si);
GetSystemDirectoryW( filename, MAX_PATH );
lstrcatW( filename, winecfgW );
Wow64DisableWow64FsRedirection( &redir );
if (CreateProcessW( filename, GetCommandLineW(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ))
......
......@@ -226,7 +226,6 @@ static BOOL CALLBACK myEnumThemeProc (LPVOID lpReserved,
/* Scan for themes */
static void scan_theme_files(void)
{
static const WCHAR themesSubdir[] = { '\\','T','h','e','m','e','s',0 };
WCHAR themesPath[MAX_PATH];
free_theme_files();
......@@ -235,7 +234,7 @@ static void scan_theme_files(void)
SHGFP_TYPE_CURRENT, themesPath))) return;
themeFiles = DSA_Create (sizeof (ThemeFile), 1);
lstrcatW (themesPath, themesSubdir);
lstrcatW (themesPath, L"\\Themes");
EnumThemes (themesPath, myEnumThemeProc, 0);
}
......@@ -561,9 +560,6 @@ static void set_color_from_theme(WCHAR *keyName, COLORREF color)
static void do_parse_theme(WCHAR *file)
{
static const WCHAR colorSect[] = {
'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
'C','o','l','o','r','s',0};
WCHAR keyName[MAX_PATH], keyNameValue[MAX_PATH];
WCHAR *keyNamePtr = NULL;
char *keyNameValueA = NULL;
......@@ -573,12 +569,12 @@ static void do_parse_theme(WCHAR *file)
WINE_TRACE("%s\n", wine_dbgstr_w(file));
GetPrivateProfileStringW(colorSect, NULL, NULL, keyName,
GetPrivateProfileStringW(L"Control Panel\\Colors", NULL, NULL, keyName,
MAX_PATH, file);
keyNamePtr = keyName;
while (*keyNamePtr!=0) {
GetPrivateProfileStringW(colorSect, keyNamePtr, NULL, keyNameValue,
GetPrivateProfileStringW(L"Control Panel\\Colors", keyNamePtr, NULL, keyNameValue,
MAX_PATH, file);
keyNameValueSize = WideCharToMultiByte(CP_ACP, 0, keyNameValue, -1,
......@@ -604,18 +600,15 @@ static void do_parse_theme(WCHAR *file)
static void on_theme_install(HWND dialog)
{
static const WCHAR filterMask[] = {0,'*','.','m','s','s','t','y','l','e','s',';',
'*','.','t','h','e','m','e',0,0};
static const WCHAR themeExt[] = {'.','T','h','e','m','e',0};
const int filterMaskLen = ARRAY_SIZE(filterMask);
static const WCHAR filterMask[] = L"\0*.msstyles;*.theme\0";
OPENFILENAMEW ofn;
WCHAR filetitle[MAX_PATH];
WCHAR file[MAX_PATH];
WCHAR filter[100];
WCHAR title[100];
LoadStringW(GetModuleHandleW(NULL), IDS_THEMEFILE, filter, ARRAY_SIZE(filter) - filterMaskLen);
memcpy(filter + lstrlenW (filter), filterMask, filterMaskLen * sizeof (WCHAR));
LoadStringW(GetModuleHandleW(NULL), IDS_THEMEFILE, filter, ARRAY_SIZE(filter) - ARRAY_SIZE(filterMask));
memcpy(filter + lstrlenW (filter), filterMask, sizeof(filterMask));
LoadStringW(GetModuleHandleW(NULL), IDS_THEMEFILE_SELECT, title, ARRAY_SIZE(title));
ofn.lStructSize = sizeof(OPENFILENAMEW);
......@@ -643,15 +636,13 @@ static void on_theme_install(HWND dialog)
if (GetOpenFileNameW(&ofn))
{
static const WCHAR themesSubdir[] = { '\\','T','h','e','m','e','s',0 };
static const WCHAR backslash[] = { '\\',0 };
WCHAR themeFilePath[MAX_PATH];
SHFILEOPSTRUCTW shfop;
if (FAILED (SHGetFolderPathW (NULL, CSIDL_RESOURCES|CSIDL_FLAG_CREATE, NULL,
SHGFP_TYPE_CURRENT, themeFilePath))) return;
if (lstrcmpiW(PathFindExtensionW(filetitle), themeExt)==0)
if (lstrcmpiW(PathFindExtensionW(filetitle), L".theme")==0)
{
do_parse_theme(file);
SendMessageW(GetParent(dialog), PSM_CHANGED, 0, 0);
......@@ -661,15 +652,14 @@ static void on_theme_install(HWND dialog)
PathRemoveExtensionW (filetitle);
/* Construct path into which the theme file goes */
lstrcatW (themeFilePath, themesSubdir);
lstrcatW (themeFilePath, backslash);
lstrcatW (themeFilePath, L"\\themes\\");
lstrcatW (themeFilePath, filetitle);
/* Create the directory */
SHCreateDirectoryExW (dialog, themeFilePath, NULL);
/* Append theme file name itself */
lstrcatW (themeFilePath, backslash);
lstrcatW (themeFilePath, L"\\");
lstrcatW (themeFilePath, PathFindFileNameW (file));
/* SHFileOperation() takes lists as input, so double-nullterminate */
themeFilePath[lstrlenW (themeFilePath)+1] = 0;
......@@ -728,8 +718,8 @@ static struct ShellFolderInfo *psfiSelected = NULL;
static void init_shell_folder_listview_headers(HWND dialog) {
LVCOLUMNW listColumn;
RECT viewRect;
WCHAR szShellFolder[64] = {'S','h','e','l','l',' ','F','o','l','d','e','r',0};
WCHAR szLinksTo[64] = {'L','i','n','k','s',' ','t','o',0};
WCHAR szShellFolder[64] = L"Shell Folder";
WCHAR szLinksTo[64] = L"Links to";
int width;
LoadStringW(GetModuleHandleW(NULL), IDS_SHELL_FOLDER, szShellFolder, ARRAY_SIZE(szShellFolder));
......
......@@ -619,10 +619,9 @@ BOOL reg_key_exists(HKEY root, const char *path, const char *name)
static void process_setting(struct setting *s)
{
static const WCHAR softwareW[] = {'S','o','f','t','w','a','r','e','\\'};
HKEY key;
BOOL needs_wow64 = (is_win64 && s->root == HKEY_LOCAL_MACHINE && s->path &&
!wcsnicmp(s->path, softwareW, ARRAY_SIZE(softwareW)));
!wcsnicmp(s->path, L"Software\\", wcslen(L"Software\\")));
if (s->value)
{
......@@ -708,16 +707,15 @@ char *keypath(const char *section)
WCHAR *keypathW(const WCHAR *section)
{
static const WCHAR appdefaultsW[] = {'A','p','p','D','e','f','a','u','l','t','s','\\',0};
static WCHAR *result = NULL;
HeapFree(GetProcessHeap(), 0, result);
if (current_app)
{
DWORD len = sizeof(appdefaultsW) + (lstrlenW(current_app) + lstrlenW(section) + 1) * sizeof(WCHAR);
DWORD len = sizeof(L"AppDefaults\\") + (lstrlenW(current_app) + lstrlenW(section) + 1) * sizeof(WCHAR);
result = HeapAlloc(GetProcessHeap(), 0, len );
lstrcpyW( result, appdefaultsW );
lstrcpyW( result, L"AppDefaults\\" );
lstrcatW( result, current_app );
if (section[0])
{
......
......@@ -42,16 +42,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(winecfg);
#define IDT_DPIEDIT 0x1234
static const WCHAR logpixels_reg[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p','\0'};
static const WCHAR def_logpixels_reg[] = {'S','o','f','t','w','a','r','e','\\','F','o','n','t','s','\0'};
static const WCHAR logpixels[] = {'L','o','g','P','i','x','e','l','s',0};
static const WCHAR desktopW[] = {'D','e','s','k','t','o','p',0};
static const WCHAR defaultW[] = {'D','e','f','a','u','l','t',0};
static const WCHAR explorerW[] = {'E','x','p','l','o','r','e','r',0};
static const WCHAR explorer_desktopsW[] = {'E','x','p','l','o','r','e','r','\\',
'D','e','s','k','t','o','p','s',0};
static const UINT dpi_values[] = { 96, 120, 144, 168, 192, 216, 240, 288, 336, 384, 432, 480 };
static BOOL updating_ui;
......@@ -71,12 +61,12 @@ static void convert_x11_desktop_key(void)
static void update_gui_for_desktop_mode(HWND dialog)
{
WCHAR *buf, *bufindex;
const WCHAR *desktop_name = current_app ? current_app : defaultW;
const WCHAR *desktop_name = current_app ? current_app : L"Default";
WINE_TRACE("\n");
updating_ui = TRUE;
buf = get_reg_keyW(config_key, explorer_desktopsW, desktop_name, NULL);
buf = get_reg_keyW(config_key, L"Explorer\\Desktops", desktop_name, NULL);
if (buf && (bufindex = wcschr(buf, 'x')))
{
*bufindex++ = 0;
......@@ -175,13 +165,10 @@ static void init_dialog(HWND dialog)
static void set_from_desktop_edits(HWND dialog)
{
static const WCHAR x[] = {'x',0};
static const WCHAR def_width[] = {'8','0','0',0};
static const WCHAR def_height[] = {'6','0','0',0};
static const WCHAR min_width[] = {'6','4','0',0};
static const WCHAR min_height[] = {'4','8','0',0};
WCHAR *width, *height, *new;
const WCHAR *desktop_name = current_app ? current_app : defaultW;
WCHAR *width, *height;
int w = 800, h = 600;
WCHAR buffer[32];
const WCHAR *desktop_name = current_app ? current_app : L"Default";
if (updating_ui) return;
......@@ -190,35 +177,15 @@ static void set_from_desktop_edits(HWND dialog)
width = get_textW(dialog, IDC_DESKTOP_WIDTH);
height = get_textW(dialog, IDC_DESKTOP_HEIGHT);
if (!width || !width[0]) {
HeapFree(GetProcessHeap(), 0, width);
width = strdupW(def_width);
}
else if (wcstol(width, NULL, 10) < wcstol(min_width, NULL, 10))
{
HeapFree(GetProcessHeap(), 0, width);
width = strdupW(min_width);
}
if (!height || !height[0]) {
HeapFree(GetProcessHeap(), 0, height);
height = strdupW(def_height);
}
else if (wcstol(height, NULL, 10) < wcstol(min_height, NULL, 10))
{
HeapFree(GetProcessHeap(), 0, height);
height = strdupW(min_height);
}
if (width && width[0]) w = max( 640, wcstol(width, NULL, 10) );
if (height && height[0]) h = max( 480, wcstol(height, NULL, 10) );
new = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(width) + lstrlenW(height) + 2) * sizeof(WCHAR));
lstrcpyW( new, width );
lstrcatW( new, x );
lstrcatW( new, height );
set_reg_keyW(config_key, explorer_desktopsW, desktop_name, new);
set_reg_keyW(config_key, keypathW(explorerW), desktopW, desktop_name);
swprintf( buffer, ARRAY_SIZE(buffer), L"%ux%u", w, h );
set_reg_keyW(config_key, L"Explorer\\Desktops", desktop_name, buffer);
set_reg_keyW(config_key, keypathW(L"Explorer"), L"Desktop", desktop_name);
HeapFree(GetProcessHeap(), 0, width);
HeapFree(GetProcessHeap(), 0, height);
HeapFree(GetProcessHeap(), 0, new);
}
static void on_enable_desktop_clicked(HWND dialog) {
......@@ -264,8 +231,8 @@ static void on_fullscreen_grab_clicked(HWND dialog)
static INT read_logpixels_reg(void)
{
DWORD dwLogPixels;
WCHAR *buf = get_reg_keyW(HKEY_CURRENT_USER, logpixels_reg, logpixels, NULL);
if (!buf) buf = get_reg_keyW(HKEY_CURRENT_CONFIG, def_logpixels_reg, logpixels, NULL);
WCHAR *buf = get_reg_keyW(HKEY_CURRENT_USER, L"Control Panel\\Desktop", L"LogPixels", NULL);
if (!buf) buf = get_reg_keyW(HKEY_CURRENT_CONFIG, L"Software\\Fonts", L"LogPixels", NULL);
dwLogPixels = buf ? *buf : DEFDPI;
HeapFree(GetProcessHeap(), 0, buf);
return dwLogPixels;
......@@ -335,7 +302,7 @@ static void update_dpi_trackbar_from_edit(HWND hDlg, BOOL fix)
if (dpi >= MINDPI && dpi <= MAXDPI)
{
SendDlgItemMessageW(hDlg, IDC_RES_TRACKBAR, TBM_SETPOS, TRUE, get_trackbar_pos(dpi));
set_reg_key_dwordW(HKEY_CURRENT_USER, logpixels_reg, logpixels, dpi);
set_reg_key_dwordW(HKEY_CURRENT_USER, L"Control Panel\\Desktop", L"LogPixels", dpi);
}
updating_ui = FALSE;
......@@ -455,7 +422,7 @@ GraphDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
int i = SendMessageW(GetDlgItem(hDlg, IDC_RES_TRACKBAR), TBM_GETPOS, 0, 0);
SetDlgItemInt(hDlg, IDC_RES_DPIEDIT, dpi_values[i], TRUE);
update_font_preview(hDlg);
set_reg_key_dwordW(HKEY_CURRENT_USER, logpixels_reg, logpixels, dpi_values[i]);
set_reg_key_dwordW(HKEY_CURRENT_USER, L"Control Panel\\Desktop", L"LogPixels", dpi_values[i]);
break;
}
}
......
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