mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 06:16:38 +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);
|
RegCloseKey(hKey);
|
||||||
HeapFree(GetProcessHeap,
|
HeapFree(GetProcessHeap(),
|
||||||
0,
|
0,
|
||||||
buf);
|
buf);
|
||||||
|
|
||||||
|
@ -225,8 +225,8 @@ GetNTPServerAddress(LPSTR* lpAddress)
|
||||||
fail:
|
fail:
|
||||||
GetError();
|
GetError();
|
||||||
if (hKey) RegCloseKey(hKey);
|
if (hKey) RegCloseKey(hKey);
|
||||||
HeapFree(GetProcessHeap, 0, buf);
|
HeapFree(GetProcessHeap(), 0, buf);
|
||||||
HeapFree(GetProcessHeap, 0, *lpAddress);
|
HeapFree(GetProcessHeap(), 0, *lpAddress);
|
||||||
return FALSE;
|
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
|
static VOID
|
||||||
InitialiseDialog(HWND hwnd)
|
InitialiseDialog(HWND hwnd)
|
||||||
{
|
{
|
||||||
//check registry if button should be checked
|
GetSyncSetting(hwnd);
|
||||||
//set button
|
|
||||||
EnableDialogText(hwnd);
|
EnableDialogText(hwnd);
|
||||||
|
|
||||||
CreateNTPServerList(hwnd);
|
CreateNTPServerList(hwnd);
|
||||||
|
|
|
@ -237,11 +237,11 @@ MonthCalReload(IN PMONTHCALWND infoPtr)
|
||||||
TCHAR szBuf[64];
|
TCHAR szBuf[64];
|
||||||
UINT i;
|
UINT i;
|
||||||
|
|
||||||
infoPtr->UIState = (DWORD) SendMessage(GetAncestor(infoPtr->hSelf,
|
infoPtr->UIState = (DWORD)SendMessage(GetAncestor(infoPtr->hSelf,
|
||||||
GA_PARENT),
|
GA_PARENT),
|
||||||
WM_QUERYUISTATE,
|
WM_QUERYUISTATE,
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
/* cache the configuration */
|
/* cache the configuration */
|
||||||
infoPtr->FirstDayOfWeek = MonthCalFirstDayOfWeek();
|
infoPtr->FirstDayOfWeek = MonthCalFirstDayOfWeek();
|
||||||
|
@ -631,8 +631,8 @@ MonthCalChangeFont(IN PMONTHCALWND infoPtr,
|
||||||
|
|
||||||
static WORD
|
static WORD
|
||||||
MonthCalPtToDay(IN PMONTHCALWND infoPtr,
|
MonthCalPtToDay(IN PMONTHCALWND infoPtr,
|
||||||
IN SHORT x,
|
IN INT x,
|
||||||
IN SHORT y)
|
IN INT y)
|
||||||
{
|
{
|
||||||
WORD Ret = 0;
|
WORD Ret = 0;
|
||||||
|
|
||||||
|
@ -1017,7 +1017,7 @@ MonthCalWndProc(IN HWND hwnd,
|
||||||
|
|
||||||
SetWindowLongPtr(hwnd,
|
SetWindowLongPtr(hwnd,
|
||||||
0,
|
0,
|
||||||
(DWORD_PTR)infoPtr);
|
(LONG_PTR)infoPtr);
|
||||||
|
|
||||||
ZeroMemory(infoPtr,
|
ZeroMemory(infoPtr,
|
||||||
sizeof(MONTHCALWND));
|
sizeof(MONTHCALWND));
|
||||||
|
|
|
@ -289,7 +289,7 @@ SetLocalTimeZone(HWND hwnd)
|
||||||
while (i < dwIndex)
|
while (i < dwIndex)
|
||||||
{
|
{
|
||||||
if (Entry == NULL)
|
if (Entry == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
Entry = Entry->Next;
|
Entry = Entry->Next;
|
||||||
|
@ -328,6 +328,9 @@ GetAutoDaylightInfo(HWND hwnd)
|
||||||
&hKey))
|
&hKey))
|
||||||
return;
|
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,
|
if (RegQueryValueExW(hKey,
|
||||||
L"DisableAutoDaylightTimeSet",
|
L"DisableAutoDaylightTimeSet",
|
||||||
NULL,
|
NULL,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue