- Use HEAP_ZERO_MEMORY instead of memset().

- Do not crash if no adapter found.

svn path=/trunk/; revision=38083
This commit is contained in:
Dmitry Gorbachev 2008-12-14 20:45:16 +00:00
parent 966a02f90b
commit e415cd9e65
2 changed files with 3 additions and 3 deletions

View file

@ -162,7 +162,7 @@ DisplayApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
InitPropSheetPage(&psh, PropPages[i].idDlg, PropPages[i].DlgProc, PropPages[i].Callback);
}
/* NOTE: Don;t call SHAddFromPropSheetExtArray here because this applet only allows
/* NOTE: Don't call SHAddFromPropSheetExtArray here because this applet only allows
replacing the background page but not extending the applet by more pages */
ret = (LONG)(PropertySheet(&psh) != -1);

View file

@ -151,8 +151,7 @@ AddDisplayDevice(IN PGLOBAL_DATA pGlobalData, IN const DISPLAY_DEVICE *DisplayDe
DWORD ResolutionsCount = 1;
DWORD i;
newEntry = HeapAlloc(GetProcessHeap(), 0, sizeof(DISPLAY_DEVICE_ENTRY));
memset(newEntry, 0, sizeof(DISPLAY_DEVICE_ENTRY));
newEntry = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DISPLAY_DEVICE_ENTRY));
if (!newEntry) goto ByeBye;
newEntry->Settings = GetPossibleSettings(DisplayDevice->DeviceName, &newEntry->SettingsCount, &newEntry->CurrentSettings);
@ -311,6 +310,7 @@ OnInitDialog(IN HWND hwndDlg)
EnableWindow(GetDlgItem(hwndDlg, IDC_SETTINGS_RESOLUTION), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_SETTINGS_RESOLUTION_TEXT), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_SETTINGS_ADVANCED), FALSE);
ShowWindow(GetDlgItem(hwndDlg, IDC_SETTINGS_SPECTRUM), SW_HIDE);
}
else if (Result == 1)
{