Reformat the source code

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2020-07-28 09:53:58 +02:00
parent 908fec06e4
commit 60d4da100e

View file

@ -11,7 +11,7 @@
static void GetLogonHoursIndices(_In_ const SYSTEMTIME* time, _In_ const TIME_ZONE_INFORMATION* tzi, _Out_ LONG* plIndexSA, _Out_ LONG* plIndexBit) static void GetLogonHoursIndices(_In_ const SYSTEMTIME* time, _In_ const TIME_ZONE_INFORMATION* tzi, _Out_ LONG* plIndexSA, _Out_ LONG* plIndexBit)
{ {
LONG wIndex = (((LONG)time->wDayOfWeek * 24 + time->wHour) * 60 + time->wMinute + tzi->Bias) / 60 % (21 * 8); LONG wIndex = (((LONG)time->wDayOfWeek * 24 + time->wHour) * 60 + time->wMinute + tzi->Bias) / 60 % (21 * 8);
*plIndexSA = wIndex / 8, *plIndexSA = wIndex / 8;
*plIndexBit = wIndex % 8; *plIndexBit = wIndex % 8;
} }
@ -30,7 +30,8 @@ static LPTSTR FormatMsg(_In_z_ LPCTSTR lpFormat, ...)
&arg)) { &arg)) {
va_end(arg); va_end(arg);
return lpBuffer; return lpBuffer;
} else { }
else {
va_end(arg); va_end(arg);
return NULL; return NULL;
} }
@ -96,7 +97,8 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
if (V_VT(&varLogonHours) == VT_EMPTY) { if (V_VT(&varLogonHours) == VT_EMPTY) {
uiResult = 0; // User has no logon hours defined uiResult = 0; // User has no logon hours defined
goto _cleanup5; goto _cleanup5;
} else if (V_VT(&varLogonHours) != (VT_ARRAY | VT_UI1)) { }
else if (V_VT(&varLogonHours) != (VT_ARRAY | VT_UI1)) {
uiResult = 7; // Invalid logon hours uiResult = 7; // Invalid logon hours
goto _cleanup5; goto _cleanup5;
} }
@ -117,7 +119,8 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
} }
if (bData & (1 << lIndexBit)) { if (bData & (1 << lIndexBit)) {
uiResult = 0; // Within logon hours uiResult = 0; // Within logon hours
} else { }
else {
uiResult = 1; // Out of logon hours uiResult = 1; // Out of logon hours
LockWorkStation(); LockWorkStation();
} }