mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:05:43 +00:00
check reg for NTP setting
fix a few typos and msvc warnings svn path=/trunk/; revision=22972
This commit is contained in:
parent
ae1a33083a
commit
ab8a344656
3 changed files with 59 additions and 14 deletions
|
@ -216,7 +216,7 @@ GetNTPServerAddress(LPSTR* lpAddress)
|
|||
}
|
||||
|
||||
RegCloseKey(hKey);
|
||||
HeapFree(GetProcessHeap,
|
||||
HeapFree(GetProcessHeap(),
|
||||
0,
|
||||
buf);
|
||||
|
||||
|
@ -225,8 +225,8 @@ GetNTPServerAddress(LPSTR* lpAddress)
|
|||
fail:
|
||||
GetError();
|
||||
if (hKey) RegCloseKey(hKey);
|
||||
HeapFree(GetProcessHeap, 0, buf);
|
||||
HeapFree(GetProcessHeap, 0, *lpAddress);
|
||||
HeapFree(GetProcessHeap(), 0, buf);
|
||||
HeapFree(GetProcessHeap(), 0, *lpAddress);
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
|
@ -326,11 +326,53 @@ EnableDialogText(HWND hwnd)
|
|||
}
|
||||
|
||||
|
||||
static VOID
|
||||
GetSyncSetting(HWND hwnd)
|
||||
{
|
||||
HKEY hKey;
|
||||
HWND hCheck;
|
||||
LONG Ret;
|
||||
WCHAR Data[8];
|
||||
DWORD Size;
|
||||
|
||||
Ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DateTime\\Parameters",
|
||||
0,
|
||||
KEY_QUERY_VALUE,
|
||||
&hKey);
|
||||
if (Ret != ERROR_SUCCESS)
|
||||
{
|
||||
GetError();
|
||||
return;
|
||||
}
|
||||
|
||||
Size = sizeof(Data);
|
||||
Ret = RegQueryValueExW(hKey,
|
||||
L"Type",
|
||||
NULL,
|
||||
NULL,
|
||||
(LPBYTE)Data,
|
||||
&Size);
|
||||
if (Ret != ERROR_SUCCESS)
|
||||
{
|
||||
GetError();
|
||||
}
|
||||
|
||||
if (lstrcmp(Data, L"NTP") == 0)
|
||||
{
|
||||
hCheck = GetDlgItem(hwnd, IDC_AUTOSYNC);
|
||||
SendMessageW(hCheck, BM_SETCHECK, 0, 0);
|
||||
}
|
||||
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
|
||||
|
||||
static VOID
|
||||
InitialiseDialog(HWND hwnd)
|
||||
{
|
||||
//check registry if button should be checked
|
||||
//set button
|
||||
GetSyncSetting(hwnd);
|
||||
|
||||
EnableDialogText(hwnd);
|
||||
|
||||
CreateNTPServerList(hwnd);
|
||||
|
|
|
@ -631,8 +631,8 @@ MonthCalChangeFont(IN PMONTHCALWND infoPtr,
|
|||
|
||||
static WORD
|
||||
MonthCalPtToDay(IN PMONTHCALWND infoPtr,
|
||||
IN SHORT x,
|
||||
IN SHORT y)
|
||||
IN INT x,
|
||||
IN INT y)
|
||||
{
|
||||
WORD Ret = 0;
|
||||
|
||||
|
@ -1017,7 +1017,7 @@ MonthCalWndProc(IN HWND hwnd,
|
|||
|
||||
SetWindowLongPtr(hwnd,
|
||||
0,
|
||||
(DWORD_PTR)infoPtr);
|
||||
(LONG_PTR)infoPtr);
|
||||
|
||||
ZeroMemory(infoPtr,
|
||||
sizeof(MONTHCALWND));
|
||||
|
|
|
@ -328,6 +328,9 @@ GetAutoDaylightInfo(HWND hwnd)
|
|||
&hKey))
|
||||
return;
|
||||
|
||||
/* if the call fails (non zero), the reg value isn't available,
|
||||
* which means it shouldn't be disabled, so we should check the button.
|
||||
*/
|
||||
if (RegQueryValueExW(hKey,
|
||||
L"DisableAutoDaylightTimeSet",
|
||||
NULL,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue