Commit c919112a authored by Alexandre Julliard's avatar Alexandre Julliard

winecfg: Display a warning when the user tries to change the load

order of a system dll.
parent d4ea4551
......@@ -204,6 +204,16 @@ BEGIN
IDS_AUDIO_MISSING "There is no audio driver currently specified in the registry.\n\nA recommended driver has been selected for you.\nYou can use this driver or select another driver if available.\n\nYou must click Apply for the selection to take effect."
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_DLL_WARNING "Changing the load order of this library is not recommended.\nAre you sure you want to do this?"
IDS_DLL_WARNING_CAPTION "Warning: system library"
IDS_DLL_NATIVE "native"
IDS_DLL_BUILTIN "builtin"
IDS_DLL_NATIVE_BUILTIN "native, builtin"
IDS_DLL_BUILTIN_NATIVE "builtin, native"
IDS_DLL_DISABLED "disabled"
END
/****************************************************************/
/* English neutral resources
......
......@@ -148,8 +148,20 @@ static const char* mode_to_string(enum dllmode mode)
/* Convert a dllmode to a pretty string for display. TODO: use translations. */
static const char* mode_to_label(enum dllmode mode)
{
WINE_FIXME("translate me\n");
return mode_to_string(mode);
static char buffer[256];
UINT id = 0;
switch( mode )
{
case NATIVE: id = IDS_DLL_NATIVE; break;
case BUILTIN: id = IDS_DLL_BUILTIN; break;
case NATIVE_BUILTIN: id = IDS_DLL_NATIVE_BUILTIN; break;
case BUILTIN_NATIVE: id = IDS_DLL_BUILTIN_NATIVE; break;
case DISABLE: id = IDS_DLL_DISABLED; break;
default: assert(FALSE);
}
if (!LoadStringA( GetModuleHandleA(NULL), id, buffer, sizeof(buffer) )) buffer[0] = 0;
return buffer;
}
/* Convert a control id (IDC_ constant) to a dllmode */
......@@ -417,6 +429,30 @@ static void on_add_click(HWND dialog)
*ptr = '\0';
}
}
/* check if dll is in the builtin-only list */
if (!(ptr = strrchr( buffer, '\\' )))
{
ptr = buffer;
if (*ptr == '*') ptr++;
}
else ptr++;
if (is_builtin_only( ptr ))
{
MSGBOXPARAMSA params;
params.cbSize = sizeof(params);
params.hwndOwner = dialog;
params.hInstance = GetModuleHandleA( NULL );
params.lpszText = MAKEINTRESOURCEA( IDS_DLL_WARNING );
params.lpszCaption = MAKEINTRESOURCEA( IDS_DLL_WARNING_CAPTION );
params.dwStyle = MB_ICONWARNING | MB_YESNO;
params.lpszIcon = NULL;
params.dwContextHelpId = 0;
params.lpfnMsgBoxCallback = NULL;
params.dwLanguageId = 0;
if (MessageBoxIndirectA( &params ) != IDYES) return;
}
SendDlgItemMessage(dialog, IDC_DLLCOMBO, WM_SETTEXT, 0, (LPARAM) "");
disable(IDC_DLLS_ADDDLL);
......
......@@ -76,6 +76,13 @@
#define IDC_DLLS_REMOVEDLL 8003
#define IDC_DLLCOMBO 8004
#define IDD_LOADORDER 8005
#define IDS_DLL_WARNING 8010
#define IDS_DLL_WARNING_CAPTION 8011
#define IDS_DLL_NATIVE 8012
#define IDS_DLL_BUILTIN 8013
#define IDS_DLL_NATIVE_BUILTIN 8014
#define IDS_DLL_BUILTIN_NATIVE 8015
#define IDS_DLL_DISABLED 8016
/* drive editing */
#define IDC_LIST_DRIVES 1042
......
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