ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
May 2019
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
17 participants
165 discussions
Start a n
N
ew thread
[reactos] 01/01: [ROSAPPS][GETTYPE] Fix a copy-paste-issue when checking for Win2000 CORE-16073
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0d20e8988d77187665310…
commit 0d20e8988d7718766531087664747b66a862c693 Author: Joachim Henze <Joachim.Henze(a)reactos.org> AuthorDate: Wed May 29 21:19:02 2019 +0200 Commit: Joachim Henze <Joachim.Henze(a)reactos.org> CommitDate: Wed May 29 21:19:02 2019 +0200 [ROSAPPS][GETTYPE] Fix a copy-paste-issue when checking for Win2000 CORE-16073 --- modules/rosapps/applications/sysutils/gettype/gettype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rosapps/applications/sysutils/gettype/gettype.c b/modules/rosapps/applications/sysutils/gettype/gettype.c index 23889fb762..dbcc62efd0 100644 --- a/modules/rosapps/applications/sysutils/gettype/gettype.c +++ b/modules/rosapps/applications/sysutils/gettype/gettype.c @@ -174,7 +174,7 @@ GetBasicInfo(LPOSVERSIONINFOEX osvi, TCHAR * HostName, TCHAR * OSName, TCHAR * V } else if(osvi->dwMajorVersion == 5) { - if(osvi->dwMajorVersion == 0) + if(osvi->dwMinorVersion == 0) { _tcscpy(OSName, _T("Microsoft Windows 2000 ")); }
5 years, 6 months
1
0
0
0
[reactos] 01/01: [NETAPI32] Implement parts of NetGetDCName and declare some parameters optional.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=adceb3807e3c57ebb60b1…
commit adceb3807e3c57ebb60b128816a558785707fd38 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Wed May 29 15:35:55 2019 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Wed May 29 15:35:55 2019 +0200 [NETAPI32] Implement parts of NetGetDCName and declare some parameters optional. --- dll/win32/netapi32/netlogon.c | 54 +++++++++++++++++++++++++++++++++++-------- dll/win32/netapi32/srvsvc.c | 14 +++++------ 2 files changed, 51 insertions(+), 17 deletions(-) diff --git a/dll/win32/netapi32/netlogon.c b/dll/win32/netapi32/netlogon.c index 605b3eed7a..98dc5c7163 100644 --- a/dll/win32/netapi32/netlogon.c +++ b/dll/win32/netapi32/netlogon.c @@ -32,7 +32,7 @@ DsGetDcNameWithAccountA( DWORD WINAPI DsGetDcNameWithAccountW( - _In_ LPCWSTR ComputerName, + _In_opt_ LPCWSTR ComputerName, _In_opt_ LPCWSTR AccountName, _In_ ULONG AccountControlBits, _In_ LPCWSTR DomainName, @@ -713,7 +713,7 @@ NetGetAnyDCName( _In_opt_ LPCWSTR DomainName, _Out_ LPBYTE *BufPtr) { - NET_API_STATUS status; + NET_API_STATUS Status; TRACE("NetGetAnyDCName(%s, %s, %p)\n", debugstr_w(ServerName), debugstr_w(DomainName), BufPtr); @@ -722,31 +722,65 @@ NetGetAnyDCName( RpcTryExcept { - status = NetrGetAnyDCName((PWSTR)ServerName, + Status = NetrGetAnyDCName((PWSTR)ServerName, (PWSTR)DomainName, (PWSTR*)BufPtr); } RpcExcept(EXCEPTION_EXECUTE_HANDLER) { - status = I_RpcMapWin32Status(RpcExceptionCode()); + Status = I_RpcMapWin32Status(RpcExceptionCode()); } RpcEndExcept; - return status; + return Status; } NET_API_STATUS WINAPI NetGetDCName( - _In_ LPCWSTR servername, - _In_ LPCWSTR domainname, - _Out_ LPBYTE *bufptr) + _In_opt_ LPCWSTR ServerName, + _In_opt_ LPCWSTR DomainName, + _Out_ LPBYTE *BufPtr) { + PDOMAIN_CONTROLLER_INFOW pDomainControllerInfo = NULL; + NET_API_STATUS Status; + FIXME("NetGetDCName(%s, %s, %p)\n", - debugstr_w(servername), debugstr_w(domainname), bufptr); + debugstr_w(ServerName), debugstr_w(DomainName), BufPtr); + + if (ServerName == NULL || *ServerName == UNICODE_NULL) + { + Status = DsGetDcNameWithAccountW(NULL, + NULL, + 0, + DomainName, + NULL, + NULL, + 0, //??? + &pDomainControllerInfo); + if (Status != NERR_Success) + goto done; + + Status = NetApiBufferAllocate((wcslen(pDomainControllerInfo->DomainControllerName) + 1) * sizeof(WCHAR), + (PVOID*)BufPtr); + if (Status != NERR_Success) + goto done; + + wcscpy((PWSTR)*BufPtr, + pDomainControllerInfo->DomainControllerName); + } + else + { + FIXME("Not implemented yet!\n"); + Status = NERR_DCNotFound; + } - return NERR_DCNotFound; +done: + if (pDomainControllerInfo != NULL) + NetApiBufferFree(pDomainControllerInfo); + + return Status; } diff --git a/dll/win32/netapi32/srvsvc.c b/dll/win32/netapi32/srvsvc.c index 680082da20..79a58fc83b 100644 --- a/dll/win32/netapi32/srvsvc.c +++ b/dll/win32/netapi32/srvsvc.c @@ -610,9 +610,9 @@ NetServerTransportEnum( NET_API_STATUS WINAPI NetSessionDel( - _In_ LMSTR servername, - _In_ LMSTR UncClientName, - _In_ LMSTR username) + _In_opt_ LMSTR servername, + _In_opt_ LMSTR UncClientName, + _In_opt_ LMSTR username) { NET_API_STATUS status; @@ -638,9 +638,9 @@ NetSessionDel( NET_API_STATUS WINAPI NetSessionEnum( - _In_ LMSTR servername, - _In_ LMSTR UncClientName, - _In_ LMSTR username, + _In_opt_ LMSTR servername, + _In_opt_ LMSTR UncClientName, + _In_opt_ LMSTR username, _In_ DWORD level, _Out_ LPBYTE *bufptr, _In_ DWORD prefmaxlen, @@ -759,7 +759,7 @@ NetSessionEnum( NET_API_STATUS WINAPI NetSessionGetInfo( - _In_ LMSTR servername, + _In_opt_ LMSTR servername, _In_ LMSTR UncClientName, _In_ LMSTR username, _In_ DWORD level,
5 years, 6 months
1
0
0
0
[reactos] 01/01: [NETLOGON] Add the netlogon service.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=78600cf22304ecf6de015…
commit 78600cf22304ecf6de01548159cef16931bffd0b Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Wed May 29 13:27:49 2019 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Wed May 29 13:37:20 2019 +0200 [NETLOGON] Add the netlogon service. --- base/services/CMakeLists.txt | 1 + base/services/netlogon/CMakeLists.txt | 22 + base/services/netlogon/netlogon.c | 183 ++++++++ base/services/netlogon/netlogon.rc | 5 + base/services/netlogon/netlogon.spec | 29 ++ base/services/netlogon/precomp.h | 34 ++ base/services/netlogon/rpcserver.c | 805 ++++++++++++++++++++++++++++++++++ 7 files changed, 1079 insertions(+) diff --git a/base/services/CMakeLists.txt b/base/services/CMakeLists.txt index 64cd734690..15bdd77bee 100644 --- a/base/services/CMakeLists.txt +++ b/base/services/CMakeLists.txt @@ -3,6 +3,7 @@ add_subdirectory(audiosrv) add_subdirectory(dcomlaunch) add_subdirectory(dhcpcsvc) add_subdirectory(eventlog) +add_subdirectory(netlogon) add_subdirectory(nfsd) add_subdirectory(rpcss) add_subdirectory(schedsvc) diff --git a/base/services/netlogon/CMakeLists.txt b/base/services/netlogon/CMakeLists.txt new file mode 100644 index 0000000000..f0e533b6b6 --- /dev/null +++ b/base/services/netlogon/CMakeLists.txt @@ -0,0 +1,22 @@ + +include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl) +add_rpc_files(server ${REACTOS_SOURCE_DIR}/sdk/include/reactos/idl/netlogon.idl) +spec2def(netlogon.dll netlogon.spec ADD_IMPORTLIB) + +list(APPEND SOURCE + netlogon.c + rpcserver.c + precomp.h) + +add_library(netlogon MODULE + ${SOURCE} + netlogon.rc + ${CMAKE_CURRENT_BINARY_DIR}/netlogon_s.c + ${CMAKE_CURRENT_BINARY_DIR}/netlogon_stubs.c + ${CMAKE_CURRENT_BINARY_DIR}/netlogon.def) + +set_module_type(netlogon win32dll UNICODE) +target_link_libraries(netlogon wine ${PSEH_LIB}) +add_importlibs(netlogon advapi32 rpcrt4 msvcrt kernel32 ntdll) +add_pch(netlogon precomp.h SOURCE) +add_cd_file(TARGET netlogon DESTINATION reactos/system32 FOR all) diff --git a/base/services/netlogon/netlogon.c b/base/services/netlogon/netlogon.c new file mode 100644 index 0000000000..0f8c4e57a9 --- /dev/null +++ b/base/services/netlogon/netlogon.c @@ -0,0 +1,183 @@ +/* + * PROJECT: ReactOS NetLogon Service + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: NetLogon service RPC server + * COPYRIGHT: Eric Kohl 2019 <eric.kohl(a)reactos.org> + */ + +/* INCLUDES *****************************************************************/ + +#include "precomp.h" + +WINE_DEFAULT_DEBUG_CHANNEL(netlogon); + + +/* GLOBALS ******************************************************************/ + +HINSTANCE hDllInstance; + +static WCHAR ServiceName[] = L"netlogon"; + +static SERVICE_STATUS_HANDLE ServiceStatusHandle; +static SERVICE_STATUS ServiceStatus; + + +/* FUNCTIONS *****************************************************************/ + +static +VOID +UpdateServiceStatus( + DWORD dwState) +{ + ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; + ServiceStatus.dwCurrentState = dwState; + ServiceStatus.dwControlsAccepted = 0; + ServiceStatus.dwWin32ExitCode = 0; + ServiceStatus.dwServiceSpecificExitCode = 0; + ServiceStatus.dwCheckPoint = 0; + + if (dwState == SERVICE_START_PENDING || + dwState == SERVICE_STOP_PENDING || + dwState == SERVICE_PAUSE_PENDING || + dwState == SERVICE_CONTINUE_PENDING) + ServiceStatus.dwWaitHint = 10000; + else + ServiceStatus.dwWaitHint = 0; + + SetServiceStatus(ServiceStatusHandle, + &ServiceStatus); +} + + +static +DWORD +WINAPI +ServiceControlHandler( + DWORD dwControl, + DWORD dwEventType, + LPVOID lpEventData, + LPVOID lpContext) +{ + TRACE("ServiceControlHandler()\n"); + + switch (dwControl) + { + case SERVICE_CONTROL_STOP: + TRACE(" SERVICE_CONTROL_STOP received\n"); + /* Stop listening to incoming RPC messages */ + RpcMgmtStopServerListening(NULL); + UpdateServiceStatus(SERVICE_STOPPED); + return ERROR_SUCCESS; + + case SERVICE_CONTROL_PAUSE: + TRACE(" SERVICE_CONTROL_PAUSE received\n"); + UpdateServiceStatus(SERVICE_PAUSED); + return ERROR_SUCCESS; + + case SERVICE_CONTROL_CONTINUE: + TRACE(" SERVICE_CONTROL_CONTINUE received\n"); + UpdateServiceStatus(SERVICE_RUNNING); + return ERROR_SUCCESS; + + case SERVICE_CONTROL_INTERROGATE: + TRACE(" SERVICE_CONTROL_INTERROGATE received\n"); + SetServiceStatus(ServiceStatusHandle, + &ServiceStatus); + return ERROR_SUCCESS; + + case SERVICE_CONTROL_SHUTDOWN: + TRACE(" SERVICE_CONTROL_SHUTDOWN received\n"); + UpdateServiceStatus(SERVICE_STOPPED); + return ERROR_SUCCESS; + + default : + TRACE(" Control %lu received\n", dwControl); + return ERROR_CALL_NOT_IMPLEMENTED; + } +} + + +static +DWORD +ServiceInit(VOID) +{ + HANDLE hThread; + + hThread = CreateThread(NULL, + 0, + (LPTHREAD_START_ROUTINE)RpcThreadRoutine, + NULL, + 0, + NULL); + + if (!hThread) + { + ERR("Can't create PortThread\n"); + return GetLastError(); + } + else + CloseHandle(hThread); + + return ERROR_SUCCESS; +} + + +VOID WINAPI +NlNetlogonMain( + _In_ INT ArgCount, + _In_ PWSTR *ArgVector) +{ + DWORD dwError; + + UNREFERENCED_PARAMETER(ArgCount); + UNREFERENCED_PARAMETER(ArgVector); + + TRACE("NlNetlogonMain(%d %p)\n", ArgCount, ArgVector); + + ServiceStatusHandle = RegisterServiceCtrlHandlerExW(ServiceName, + ServiceControlHandler, + NULL); + if (!ServiceStatusHandle) + { + ERR("RegisterServiceCtrlHandlerExW() failed! (Error %lu)\n", GetLastError()); + return; + } + + UpdateServiceStatus(SERVICE_START_PENDING); + + dwError = ServiceInit(); + if (dwError != ERROR_SUCCESS) + { + ERR("Service stopped (dwError: %lu\n", dwError); + UpdateServiceStatus(SERVICE_STOPPED); + return; + } + + UpdateServiceStatus(SERVICE_RUNNING); +} + + +BOOL +WINAPI +DllMain( + _In_ HINSTANCE hinstDLL, + _In_ DWORD fdwReason, + _In_ PVOID pvReserved) +{ + UNREFERENCED_PARAMETER(pvReserved); + + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinstDLL); + hDllInstance = hinstDLL; + break; + + case DLL_PROCESS_DETACH: + break; + } + + return TRUE; +} + +/* EOF */ diff --git a/base/services/netlogon/netlogon.rc b/base/services/netlogon/netlogon.rc new file mode 100644 index 0000000000..19c828e00b --- /dev/null +++ b/base/services/netlogon/netlogon.rc @@ -0,0 +1,5 @@ +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "Net Logon Services Dll" +#define REACTOS_STR_INTERNAL_NAME "netlogon" +#define REACTOS_STR_ORIGINAL_FILENAME "netlogon.dll" +#include <reactos/version.rc> diff --git a/base/services/netlogon/netlogon.spec b/base/services/netlogon/netlogon.spec new file mode 100644 index 0000000000..2fe6ee3958 --- /dev/null +++ b/base/services/netlogon/netlogon.spec @@ -0,0 +1,29 @@ +@ stdcall DsrGetDcName(wstr wstr ptr ptr long ptr) +@ stdcall DsrGetDcNameEx2(wstr wstr long wstr ptr wstr long ptr) +@ stub I_DsGetDcCache +@ stub I_NetLogonAddressToSiteName +@ stub I_NetLogonAppendChangeLog +@ stub I_NetLogonCloseChangeLog +@ stub I_NetLogonFree +@ stub I_NetLogonGetAuthDataEx +@ stub I_NetLogonGetDirectDomain +@ stub I_NetLogonGetIpAddresses +@ stub I_NetLogonGetSerialNumber +@ stub I_NetLogonLdapLookup +@ stub I_NetLogonLdapLookupEx +@ stub I_NetLogonMixedDomain +@ stub I_NetLogonNewChangeLog +@ stub I_NetLogonReadChangeLog +@ stub I_NetLogonSendToSamOnPdc +@ stub I_NetLogonSetServiceBits +@ stub I_NetNotifyDelta +@ stub I_NetNotifyDsChange +@ stub I_NetNotifyMachineAccount +@ stub I_NetNotifyNetlogonDllHandle +@ stub I_NetNotifyNtdsDsaDeletion +@ stub I_NetNotifyRole +@ stub I_NetNotifyTrustedDomain +@ stub InitSecurityInterfaceW +@ stdcall NetrLogonSamLogoff(wstr wstr ptr ptr long ptr) +@ stdcall NetrLogonSamLogon(wstr wstr ptr ptr long ptr long ptr ptr) +@ stdcall NlNetlogonMain(long ptr) diff --git a/base/services/netlogon/precomp.h b/base/services/netlogon/precomp.h new file mode 100644 index 0000000000..b5317958a0 --- /dev/null +++ b/base/services/netlogon/precomp.h @@ -0,0 +1,34 @@ +/* + * PROJECT: ReactOS NetLogon Service + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: NetLogon service RPC server + * COPYRIGHT: Eric Kohl 2019 <eric.kohl(a)reactos.org> + */ + +#ifndef _NETLOGON_PCH_ +#define _NETLOGON_PCH_ + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H +#include <limits.h> +#include <stdarg.h> +#include <stdio.h> +#include <windef.h> +#include <winbase.h> +#include <winreg.h> +#include <winsvc.h> +#include <lmerr.h> + +#include <netlogon_s.h> + +#include <wine/debug.h> + +extern HINSTANCE hDllInstance; + +DWORD +WINAPI +RpcThreadRoutine( + LPVOID lpParameter); + +#endif /* _NETLOGON_PCH_ */ diff --git a/base/services/netlogon/rpcserver.c b/base/services/netlogon/rpcserver.c new file mode 100644 index 0000000000..e4115ad09e --- /dev/null +++ b/base/services/netlogon/rpcserver.c @@ -0,0 +1,805 @@ +/* + * PROJECT: ReactOS NetLogon Service + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: NetLogon service RPC server + * COPYRIGHT: Eric Kohl 2019 <eric.kohl(a)reactos.org> + */ + +/* INCLUDES *****************************************************************/ + +#include "precomp.h" + +//#include "lmerr.h" + +WINE_DEFAULT_DEBUG_CHANNEL(netlogon); + +/* FUNCTIONS *****************************************************************/ + +DWORD +WINAPI +RpcThreadRoutine( + LPVOID lpParameter) +{ + RPC_STATUS Status; + + Status = RpcServerUseProtseqEpW(L"ncacn_np", 20, L"\\pipe\\netlogon", NULL); + if (Status != RPC_S_OK) + { + ERR("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status); + return 0; + } + + Status = RpcServerRegisterIf(logon_v1_0_s_ifspec, NULL, NULL); + if (Status != RPC_S_OK) + { + ERR("RpcServerRegisterIf() failed (Status %lx)\n", Status); + return 0; + } + + Status = RpcServerListen(1, RPC_C_LISTEN_MAX_CALLS_DEFAULT, FALSE); + if (Status != RPC_S_OK) + { + ERR("RpcServerListen() failed (Status %lx)\n", Status); + } + + return 0; +} + + +void __RPC_FAR * __RPC_USER midl_user_allocate(SIZE_T len) +{ + return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); +} + + +void __RPC_USER midl_user_free(void __RPC_FAR * ptr) +{ + HeapFree(GetProcessHeap(), 0, ptr); +} + + +/* Function 0 */ +NET_API_STATUS +__stdcall +NetrLogonUasLogon( + _In_opt_ LOGONSRV_HANDLE ServerName, + _In_ wchar_t *UserName, + _In_ wchar_t *Workstation, + _Out_ PNETLOGON_VALIDATION_UAS_INFO *ValidationInformation) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 1 */ +NET_API_STATUS +__stdcall +NetrLogonUasLogoff( + _In_opt_ LOGONSRV_HANDLE ServerName, + _In_ wchar_t *UserName, + _In_ wchar_t *Workstation, + _Out_ PNETLOGON_LOGOFF_UAS_INFO LogoffInformation) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 2 */ +NTSTATUS +__stdcall +NetrLogonSamLogon( + _In_opt_ LOGONSRV_HANDLE LogonServer, + _In_opt_ wchar_t *ComputerName, + _In_opt_ PNETLOGON_AUTHENTICATOR Authenticator, + _Inout_opt_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _In_ NETLOGON_LOGON_INFO_CLASS LogonLevel, + _In_ PNETLOGON_LEVEL LogonInformation, + _In_ NETLOGON_VALIDATION_INFO_CLASS ValidationLevel, + _Out_ PNETLOGON_VALIDATION ValidationInformation, + _Out_ UCHAR *Authoritative) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 3 */ +NTSTATUS +__stdcall +NetrLogonSamLogoff( + _In_opt_ LOGONSRV_HANDLE LogonServer, + _In_opt_ wchar_t *ComputerName, + _In_opt_ PNETLOGON_AUTHENTICATOR Authenticator, + _Inout_opt_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _In_ NETLOGON_LOGON_INFO_CLASS LogonLevel, + _In_ PNETLOGON_LEVEL LogonInformation) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 4 */ +NTSTATUS +__stdcall +NetrServerReqChallenge( + _In_opt_ LOGONSRV_HANDLE PrimaryName, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_CREDENTIAL ClientChallenge, + _Out_ PNETLOGON_CREDENTIAL ServerChallenge) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 5 */ +NTSTATUS +__stdcall +NetrServerAuthenticate( + _In_opt_ LOGONSRV_HANDLE PrimaryName, + _In_ wchar_t *AccountName, + _In_ NETLOGON_SECURE_CHANNEL_TYPE SecureChannelType, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_CREDENTIAL ClientCredential, + _Out_ PNETLOGON_CREDENTIAL ServerCredential) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 6 */ +NTSTATUS +__stdcall +NetrServerPasswordSet( + _In_opt_ LOGONSRV_HANDLE PrimaryName, + _In_ wchar_t *AccountName, + _In_ NETLOGON_SECURE_CHANNEL_TYPE SecureChannelType, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_AUTHENTICATOR Authenticator, + _Out_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _In_ PENCRYPTED_NT_OWF_PASSWORD UasNewPassword) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 7 */ +NTSTATUS +__stdcall +NetrDatabaseDeltas( + _In_ LOGONSRV_HANDLE PrimaryName, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_AUTHENTICATOR Authenticator, + _Inout_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _In_ DWORD DatabaseID, + _Inout_ PNLPR_MODIFIED_COUNT DomainModifiedCount, + _Out_ PNETLOGON_DELTA_ENUM_ARRAY *DeltaArray, + _In_ DWORD PreferredMaximumLength) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 8 */ +NTSTATUS +__stdcall +NetrDatabaseSync( + _In_ LOGONSRV_HANDLE PrimaryName, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_AUTHENTICATOR Authenticator, + _Inout_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _In_ DWORD DatabaseID, + _Inout_ ULONG *SyncContext, + _Out_ PNETLOGON_DELTA_ENUM_ARRAY *DeltaArray, + _In_ DWORD PreferredMaximumLength) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 9 */ +NTSTATUS +__stdcall +NetrAccountDeltas( + _In_opt_ LOGONSRV_HANDLE PrimaryName, + _In_ wchar_t * ComputerName, + _In_ PNETLOGON_AUTHENTICATOR Authenticator, + _Inout_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _In_ PUAS_INFO_0 RecordId, + _In_ DWORD Count, + _In_ DWORD Level, + _Out_ UCHAR *Buffer, + _In_ DWORD BufferSize, + _Out_ ULONG *CountReturned, + _Out_ ULONG *TotalEntries, + _Out_ PUAS_INFO_0 NextRecordId) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 10 */ +NTSTATUS +__stdcall +NetrAccountSync( + _In_opt_ LOGONSRV_HANDLE PrimaryName, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_AUTHENTICATOR Authenticator, + _Inout_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _In_ DWORD Reference, + _In_ DWORD Level, + _Out_ UCHAR *Buffer, + _In_ DWORD BufferSize, + _Out_ ULONG *CountReturned, + _Out_ ULONG *TotalEntries, + _Out_ ULONG *NextReference, + _Out_ PUAS_INFO_0 LastRecordId) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 11 */ +NET_API_STATUS +__stdcall +NetrGetDCName( + _In_ LOGONSRV_HANDLE ServerName, + _In_opt_ wchar_t *DomainName, + _Out_ wchar_t **Buffer) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 12 */ +NET_API_STATUS +__stdcall +NetrLogonControl( + _In_opt_ LOGONSRV_HANDLE ServerName, + _In_ DWORD FunctionCode, + _In_ DWORD QueryLevel, + _Out_ PNETLOGON_CONTROL_QUERY_INFORMATION Buffer) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 13 */ +NET_API_STATUS +__stdcall +NetrGetAnyDCName( + _In_opt_ LOGONSRV_HANDLE ServerName, + _In_opt_ wchar_t *DomainName, + _Out_ wchar_t **Buffer) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 14 */ +NET_API_STATUS +__stdcall +NetrLogonControl2( + _In_opt_ LOGONSRV_HANDLE ServerName, + _In_ DWORD FunctionCode, + _In_ DWORD QueryLevel, + _In_ PNETLOGON_CONTROL_DATA_INFORMATION Data, + _Out_ PNETLOGON_CONTROL_QUERY_INFORMATION Buffer) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 15 */ +NTSTATUS +__stdcall +NetrServerAuthenticate2( + _In_opt_ LOGONSRV_HANDLE PrimaryName, + _In_ wchar_t *AccountName, + _In_ NETLOGON_SECURE_CHANNEL_TYPE SecureChannelType, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_CREDENTIAL ClientCredential, + _Out_ PNETLOGON_CREDENTIAL ServerCredential, + _Inout_ ULONG *NegotiateFlags) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 16 */ +NTSTATUS +__stdcall +NetrDatabaseSync2( + _In_ LOGONSRV_HANDLE PrimaryName, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_AUTHENTICATOR Authenticator, + _Inout_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _In_ DWORD DatabaseID, + _In_ SYNC_STATE RestartState, + _Inout_ ULONG *SyncContext, + _Out_ PNETLOGON_DELTA_ENUM_ARRAY *DeltaArray, + _In_ DWORD PreferredMaximumLength) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 17 */ +NTSTATUS +__stdcall +NetrDatabaseRedo( + _In_ LOGONSRV_HANDLE PrimaryName, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_AUTHENTICATOR Authenticator, + _Inout_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _In_ UCHAR *ChangeLogEntry, + _In_ DWORD ChangeLogEntrySize, + _Out_ PNETLOGON_DELTA_ENUM_ARRAY *DeltaArray) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 18 */ +NET_API_STATUS +__stdcall +NetrLogonControl2Ex( + _In_opt_ LOGONSRV_HANDLE ServerName, + _In_ DWORD FunctionCode, + _In_ DWORD QueryLevel, + _In_ PNETLOGON_CONTROL_DATA_INFORMATION Data, + _Out_ PNETLOGON_CONTROL_QUERY_INFORMATION Buffer) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 19 */ +NTSTATUS +__stdcall +NetrEnumerateTrustedDomains( + _In_opt_ LOGONSRV_HANDLE ServerName, + _Out_ PDOMAIN_NAME_BUFFER DomainNameBuffer) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 20 */ +NET_API_STATUS +__stdcall +DsrGetDcName( + _In_opt_ LOGONSRV_HANDLE ComputerName, + _In_opt_ wchar_t *DomainName, + _In_opt_ GUID *DomainGuid, + _In_opt_ GUID *SiteGuid, + _In_ ULONG Flags, + _Out_ PDOMAIN_CONTROLLER_INFOW *DomainControllerInfo) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 21 */ +NTSTATUS +__stdcall +NetrLogonGetCapabilities( + _In_ LOGONSRV_HANDLE ServerName, + _In_opt_ wchar_t *ComputerName, + _In_ PNETLOGON_AUTHENTICATOR Authenticator, + _Inout_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _In_ DWORD QueryLevel, + _Out_ PNETLOGON_CAPABILITIES ServerCapabilities) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 22 */ +NTSTATUS +__stdcall +NetrLogonSetServiceBits( + _In_opt_ LOGONSRV_HANDLE ServerName, + _In_ DWORD ServiceBitsOfInterest, + _In_ DWORD ServiceBits) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 23 */ +NET_API_STATUS +__stdcall +NetrLogonGetTrustRid( + _In_opt_ LOGONSRV_HANDLE ServerName, + _In_opt_ wchar_t *DomainName, + _Out_ ULONG *Rid) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 24 */ +NET_API_STATUS +__stdcall +NetrLogonComputeServerDigest( + _In_opt_ LOGONSRV_HANDLE ServerName, + _In_ ULONG Rid, + _In_ UCHAR *Message, + _In_ ULONG MessageSize, + _Out_ CHAR NewMessageDigest[16], + _Out_ CHAR OldMessageDigest[16]) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 25 */ +NET_API_STATUS +__stdcall +NetrLogonComputeClientDigest( + _In_opt_ LOGONSRV_HANDLE ServerName, + _In_opt_ wchar_t *DomainName, + _In_ UCHAR *Message, + _In_ ULONG MessageSize, + _Out_ CHAR NewMessageDigest[16], + _Out_ CHAR OldMessageDigest[16]) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 26 */ +NTSTATUS +__stdcall +NetrServerAuthenticate3( + _In_opt_ LOGONSRV_HANDLE PrimaryName, + _In_ wchar_t *AccountName, + _In_ NETLOGON_SECURE_CHANNEL_TYPE SecureChannelType, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_CREDENTIAL ClientCredential, + _Out_ PNETLOGON_CREDENTIAL ServerCredential, + _Inout_ ULONG *NegotiateFlags, + _Out_ ULONG *AccountRid) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 27 */ +NET_API_STATUS +__stdcall +DsrGetDcNameEx( + _In_opt_ LOGONSRV_HANDLE ComputerName, + _In_opt_ wchar_t *DomainName, + _In_opt_ GUID *DomainGuid, + _In_opt_ wchar_t *SiteName, + _In_ ULONG Flags, + _Out_ PDOMAIN_CONTROLLER_INFOW *DomainControllerInfo) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 28 */ +NET_API_STATUS +__stdcall +DsrGetSiteName( + _In_opt_ LOGONSRV_HANDLE ComputerName, + _Out_ wchar_t **SiteName) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 29 */ +NTSTATUS +__stdcall +NetrLogonGetDomainInfo( + _In_ LOGONSRV_HANDLE ServerName, + _In_opt_ wchar_t *ComputerName, + _In_ PNETLOGON_AUTHENTICATOR Authenticator, + _Inout_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _In_ DWORD Level, + _In_ PNETLOGON_WORKSTATION_INFORMATION WkstaBuffer, + _Out_ PNETLOGON_DOMAIN_INFORMATION DomBuffer) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 30 */ +NTSTATUS +__stdcall +NetrServerPasswordSet2( + _In_opt_ LOGONSRV_HANDLE PrimaryName, + _In_ wchar_t *AccountName, + _In_ NETLOGON_SECURE_CHANNEL_TYPE SecureChannelType, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_AUTHENTICATOR Authenticator, + _Out_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _In_ PNL_TRUST_PASSWORD ClearNewPassword) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 31 */ +NTSTATUS +__stdcall +NetrServerPasswordGet( + _In_opt_ LOGONSRV_HANDLE PrimaryName, + _In_ wchar_t *AccountName, + _In_ NETLOGON_SECURE_CHANNEL_TYPE AccountType, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_AUTHENTICATOR Authenticator, + _Out_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _Out_ PENCRYPTED_NT_OWF_PASSWORD EncryptedNtOwfPassword) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 32 */ +NTSTATUS +__stdcall +NetrLogonSendToSam( + _In_opt_ LOGONSRV_HANDLE PrimaryName, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_AUTHENTICATOR Authenticator, + _Out_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _In_ UCHAR *OpaqueBuffer, + _In_ ULONG OpaqueBufferSize) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 33 */ +NET_API_STATUS +__stdcall +DsrAddressToSiteNamesW( + _In_opt_ LOGONSRV_HANDLE ComputerName, + _In_ DWORD EntryCount, + _In_ PNL_SOCKET_ADDRESS SocketAddresses, + _Out_ PNL_SITE_NAME_ARRAY *SiteNames) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 34 */ +NET_API_STATUS +__stdcall +DsrGetDcNameEx2( + _In_opt_ LOGONSRV_HANDLE ComputerName, + _In_opt_ wchar_t *AccountName, + _In_ ULONG AllowableAccountControlBits, + _In_opt_ wchar_t *DomainName, + _In_opt_ GUID *DomainGuid, + _In_opt_ wchar_t *SiteName, + _In_ ULONG Flags, + _Out_ PDOMAIN_CONTROLLER_INFOW *DomainControllerInfo) +{ + UNIMPLEMENTED; + return NERR_DCNotFound; +} + + +/* Function 35 */ +NET_API_STATUS +__stdcall +NetrLogonGetTimeServiceParentDomain( + _In_opt_ LOGONSRV_HANDLE ServerName, + _Out_ wchar_t **DomainName, + _Out_ int *PdcSameSite) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 36 */ +NET_API_STATUS +__stdcall +NetrEnumerateTrustedDomainsEx( + _In_opt_ LOGONSRV_HANDLE ServerName, + _Out_ PNETLOGON_TRUSTED_DOMAIN_ARRAY Domains) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 37 */ +NET_API_STATUS +__stdcall +DsrAddressToSiteNamesExW( + _In_opt_ LOGONSRV_HANDLE ComputerName, + _In_ DWORD EntryCount, + _In_ PNL_SOCKET_ADDRESS SocketAddresses, + _Out_ PNL_SITE_NAME_EX_ARRAY *SiteNames) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 38 */ +NET_API_STATUS +__stdcall +DsrGetDcSiteCoverageW( + _In_opt_ LOGONSRV_HANDLE ServerName, + _Out_ PNL_SITE_NAME_ARRAY *SiteNames) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 39 */ +NTSTATUS +__stdcall +NetrLogonSamLogonEx( + _In_ handle_t ContextHandle, + _In_opt_ wchar_t *LogonServer, + _In_opt_ wchar_t *ComputerName, + _In_ NETLOGON_LOGON_INFO_CLASS LogonLevel, + _In_ PNETLOGON_LEVEL LogonInformation, + _In_ NETLOGON_VALIDATION_INFO_CLASS ValidationLevel, + _Out_ PNETLOGON_VALIDATION ValidationInformation, + _Out_ UCHAR *Authoritative, + _Inout_ ULONG *ExtraFlags) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 40 */ +NET_API_STATUS +__stdcall +DsrEnumerateDomainTrusts( + _In_opt_ LOGONSRV_HANDLE ServerName, + _In_ ULONG Flags, + _Out_ PNETLOGON_TRUSTED_DOMAIN_ARRAY Domains) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 41 */ +NET_API_STATUS +__stdcall +DsrDeregisterDnsHostRecords( + _In_opt_ LOGONSRV_HANDLE ServerName, + _In_opt_ wchar_t *DnsDomainName, + _In_opt_ GUID *DomainGuid, + _In_opt_ GUID *DsaGuid, + _In_ wchar_t *DnsHostName) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 42 */ +NTSTATUS +__stdcall +NetrServerTrustPasswordsGet( + _In_opt_ LOGONSRV_HANDLE TrustedDcName, + _In_ wchar_t *AccountName, + _In_ NETLOGON_SECURE_CHANNEL_TYPE SecureChannelType, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_AUTHENTICATOR Authenticator, + _Out_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _Out_ PENCRYPTED_NT_OWF_PASSWORD EncryptedNewOwfPassword, + _Out_ PENCRYPTED_NT_OWF_PASSWORD EncryptedOldOwfPassword) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 43 */ +NET_API_STATUS +__stdcall +DsrGetForestTrustInformation( + _In_opt_ LOGONSRV_HANDLE ServerName, + _In_opt_ wchar_t *TrustedDomainName, + _In_ DWORD Flags, + _Out_ PLSA_FOREST_TRUST_INFORMATION *ForestTrustInfo) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 44 */ +NTSTATUS +__stdcall +NetrGetForestTrustInformation( + _In_opt_ LOGONSRV_HANDLE ServerName, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_AUTHENTICATOR Authenticator, + _Out_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _In_ DWORD Flags, + _Out_ PLSA_FOREST_TRUST_INFORMATION *ForestTrustInfo) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 45 */ +NTSTATUS +__stdcall +NetrLogonSamLogonWithFlags( + _In_opt_ LOGONSRV_HANDLE LogonServer, + _In_opt_ wchar_t *ComputerName, + _In_opt_ PNETLOGON_AUTHENTICATOR Authenticator, + _Inout_opt_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _In_ NETLOGON_LOGON_INFO_CLASS LogonLevel, + _In_ PNETLOGON_LEVEL LogonInformation, + _In_ NETLOGON_VALIDATION_INFO_CLASS ValidationLevel, + _Out_ PNETLOGON_VALIDATION ValidationInformation, + _Out_ UCHAR *Authoritative, + _Inout_ ULONG *ExtraFlags) +{ + UNIMPLEMENTED; + return 0; +} + + +/* Function 46 */ +NTSTATUS +__stdcall +NetrServerGetTrustInfo( + _In_opt_ LOGONSRV_HANDLE TrustedDcName, + _In_ wchar_t *AccountName, + _In_ NETLOGON_SECURE_CHANNEL_TYPE SecureChannelType, + _In_ wchar_t *ComputerName, + _In_ PNETLOGON_AUTHENTICATOR Authenticator, + _Out_ PNETLOGON_AUTHENTICATOR ReturnAuthenticator, + _Out_ PENCRYPTED_NT_OWF_PASSWORD EncryptedNewOwfPassword, + _Out_ PENCRYPTED_NT_OWF_PASSWORD EncryptedOldOwfPassword, + _Out_ PNL_GENERIC_RPC_DATA *TrustInfo) +{ + UNIMPLEMENTED; + return 0; +} + +/* EOF */
5 years, 6 months
1
0
0
0
[reactos] 01/01: [WIN32KNT_APITEST] Split win32knt_apitest to 3 modules (#1588)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ec14b4c50af0c6ad343f9…
commit ec14b4c50af0c6ad343f9c22c53501390c446722 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed May 29 20:32:32 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Wed May 29 20:32:32 2019 +0900 [WIN32KNT_APITEST] Split win32knt_apitest to 3 modules (#1588) Split win32knt_apitest to 3 modules (win32knt_apitest, win32knt_xpsp2_apitest and win32knt_2k3sp2_apitest) for usability. These 3 modules are different in linking (win32u.dll, win32u_xpsp2.dll and win32u_2k3sp2.dll). I think it's better to separate for clarity. --- modules/rostests/apitests/win32nt/CMakeLists.txt | 60 +++++++++++++++++------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/modules/rostests/apitests/win32nt/CMakeLists.txt b/modules/rostests/apitests/win32nt/CMakeLists.txt index 666f823a38..8ef26f564d 100644 --- a/modules/rostests/apitests/win32nt/CMakeLists.txt +++ b/modules/rostests/apitests/win32nt/CMakeLists.txt @@ -64,23 +64,47 @@ list(APPEND SOURCE #osver.c win32nt.h) -add_executable(win32knt_apitest - ${SOURCE} - testlist.c - w32knapi.rc) +add_library(win32knt_static STATIC ${SOURCE} w32knapi.rc) +add_dependencies(win32knt_static xdk) +add_pch(win32knt_static win32nt.h SOURCE) -target_link_libraries(win32knt_apitest ${PSEH_LIB} gditools) -set_module_type(win32knt_apitest win32cui) -add_importlibs(win32knt_apitest - win32u # win32u_2ksp4 win32u_xpsp2 win32u_2k3sp2 win32u_vista - gdi32 - user32 - shell32 - advapi32 - msvcrt - kernel32 - ntdll) +set(WIN32KNT_IMPORTLIBS gdi32 user32 shell32 advapi32 msvcrt kernel32 ntdll) -add_dependencies(win32knt_apitest xdk) -add_pch(win32knt_apitest win32nt.h SOURCE) -add_rostests_file(TARGET win32knt_apitest) +if(1) # ros + add_executable(win32knt_apitest testlist.c) + target_link_libraries(win32knt_apitest ${PSEH_LIB} win32knt_static gditools) + set_module_type(win32knt_apitest win32cui) + add_importlibs(win32knt_apitest win32u ${WIN32KNT_IMPORTLIBS}) + + add_rostests_file(TARGET win32knt_apitest) +endif() + +if(0) # Specify 1 if you want 2ksp4 version + # See also ../win32u/CMakeLists.txt + add_executable(win32knt_2ksp4_apitest testlist.c) + target_link_libraries(win32knt_2ksp4_apitest ${PSEH_LIB} win32knt_static gditools) + set_module_type(win32knt_2ksp4_apitest win32cui) + add_importlibs(win32knt_2ksp4_apitest win32u_2ksp4 ${WIN32KNT_IMPORTLIBS}) +endif() + +if(1) # xpsp2 + add_executable(win32knt_xpsp2_apitest testlist.c) + target_link_libraries(win32knt_xpsp2_apitest ${PSEH_LIB} win32knt_static gditools) + set_module_type(win32knt_xpsp2_apitest win32cui) + add_importlibs(win32knt_xpsp2_apitest win32u_xpsp2 ${WIN32KNT_IMPORTLIBS}) +endif() + +if(1) # 2k3sp2 + add_executable(win32knt_2k3sp2_apitest testlist.c) + target_link_libraries(win32knt_2k3sp2_apitest ${PSEH_LIB} win32knt_static gditools) + set_module_type(win32knt_2k3sp2_apitest win32cui) + add_importlibs(win32knt_2k3sp2_apitest win32u_2k3sp2 ${WIN32KNT_IMPORTLIBS}) +endif() + +if(0) # Specify 1 if you want vista version + # See also ../win32u/CMakeLists.txt + add_executable(win32knt_vista_apitest testlist.c) + target_link_libraries(win32knt_vista_apitest ${PSEH_LIB} win32knt_static gditools) + set_module_type(win32knt_vista_apitest win32cui) + add_importlibs(win32knt_vista_apitest win32u_vista ${WIN32KNT_IMPORTLIBS}) +endif()
5 years, 6 months
1
0
0
0
[reactos] 01/01: [NETAPI32] Implement NetpAllocWStrFromStr(), NetpAllocWStrFromAnsiStr() (not public, but useful) and NetpAllocWStrFromWStr().
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=968bdeddf3306aed5dfd2…
commit 968bdeddf3306aed5dfd2e1be375cd3bef324b60 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Wed May 29 12:56:43 2019 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Wed May 29 12:59:44 2019 +0200 [NETAPI32] Implement NetpAllocWStrFromStr(), NetpAllocWStrFromAnsiStr() (not public, but useful) and NetpAllocWStrFromWStr(). --- dll/win32/netapi32/misc.c | 85 ++++++++++++++++++++++++++++++++++++++++ dll/win32/netapi32/netapi32.h | 24 ++++++++++-- dll/win32/netapi32/netapi32.spec | 4 +- 3 files changed, 107 insertions(+), 6 deletions(-) diff --git a/dll/win32/netapi32/misc.c b/dll/win32/netapi32/misc.c index 0d236e2ed4..5e541b693f 100644 --- a/dll/win32/netapi32/misc.c +++ b/dll/win32/netapi32/misc.c @@ -135,6 +135,91 @@ NetUnregisterDomainNameChangeNotification( } +PWSTR +WINAPI +NetpAllocWStrFromAnsiStr( + _In_ PSTR InString) +{ + ANSI_STRING AnsiString; + UNICODE_STRING UnicodeString; + ULONG Size; + NET_API_STATUS NetStatus; + NTSTATUS Status; + + RtlInitAnsiString(&AnsiString, InString); + + Size = RtlAnsiStringToUnicodeSize(&AnsiString); + NetStatus = NetApiBufferAllocate(Size, + (PVOID*)&UnicodeString.Buffer); + if (NetStatus != NERR_Success) + return NULL; + + Status = RtlAnsiStringToUnicodeString(&UnicodeString, + &AnsiString, + FALSE); + if (!NT_SUCCESS(Status)) + { + NetApiBufferFree(UnicodeString.Buffer); + return NULL; + } + + return UnicodeString.Buffer; +} + + +PWSTR +WINAPI +NetpAllocWStrFromStr( + _In_ PSTR InString) +{ + OEM_STRING OemString; + UNICODE_STRING UnicodeString; + ULONG Size; + NET_API_STATUS NetStatus; + NTSTATUS Status; + + RtlInitAnsiString((PANSI_STRING)&OemString, InString); + + Size = RtlOemStringToUnicodeSize(&OemString); + NetStatus = NetApiBufferAllocate(Size, + (PVOID*)&UnicodeString.Buffer); + if (NetStatus != NERR_Success) + return NULL; + + Status = RtlOemStringToUnicodeString(&UnicodeString, + &OemString, + FALSE); + if (!NT_SUCCESS(Status)) + { + NetApiBufferFree(UnicodeString.Buffer); + return NULL; + } + + return UnicodeString.Buffer; +} + + +PWSTR +WINAPI +NetpAllocWStrFromWStr( + _In_ PWSTR InString) +{ + PWSTR OutString; + ULONG Size; + NET_API_STATUS Status; + + Size = (wcslen(InString) + 1) * sizeof(WCHAR); + Status = NetApiBufferAllocate(Size, + (PVOID*)&OutString); + if (Status != NERR_Success) + return NULL; + + wcscpy(OutString, InString); + + return OutString; +} + + NET_API_STATUS WINAPI NetpNtStatusToApiStatus( diff --git a/dll/win32/netapi32/netapi32.h b/dll/win32/netapi32/netapi32.h index 451865707f..7a839ef51f 100644 --- a/dll/win32/netapi32/netapi32.h +++ b/dll/win32/netapi32/netapi32.h @@ -33,10 +33,6 @@ extern LIST_ENTRY g_EnumContextListHead; extern CRITICAL_SECTION g_EnumContextListLock; -NET_API_STATUS -WINAPI -NetpNtStatusToApiStatus(NTSTATUS Status); - /* misc.c */ NTSTATUS @@ -68,6 +64,26 @@ CopySidFromSidAndRid( _In_ PSID SrcSid, _In_ ULONG RelativeId); +PWSTR +WINAPI +NetpAllocWStrFromAnsiStr( + _In_ PSTR InString); + +PWSTR +WINAPI +NetpAllocWStrFromStr( + _In_ PSTR InString); + +PWSTR +WINAPI +NetpAllocWStrFromWStr( + _In_ PWSTR InString); + +NET_API_STATUS +WINAPI +NetpNtStatusToApiStatus( + _In_ NTSTATUS Status); + /* wksta.c */ BOOL diff --git a/dll/win32/netapi32/netapi32.spec b/dll/win32/netapi32/netapi32.spec index dda3b36b6e..f4e8824464 100644 --- a/dll/win32/netapi32/netapi32.spec +++ b/dll/win32/netapi32/netapi32.spec @@ -269,8 +269,8 @@ @ stub NetpAllocConfigName @ stub NetpAllocFtinfoEntry @ stub NetpAllocStrFromWStr -@ stub NetpAllocWStrFromStr -@ stub NetpAllocWStrFromWStr +@ stdcall NetpAllocWStrFromStr(str) +@ stdcall NetpAllocWStrFromWStr(wstr) @ stub NetpApiStatusToNtStatus @ stub NetpAssertFailed @ stub NetpCleanFtinfoContext
5 years, 6 months
1
0
0
0
[reactos] 01/01: [SYSSETUP] Set registry hostname in WriteComputerSettings (#1589)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9a39315d467b0641169f8…
commit 9a39315d467b0641169f8d5dbd5d9eeb1b07f7e1 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed May 29 19:59:40 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Wed May 29 19:59:40 2019 +0900 [SYSSETUP] Set registry hostname in WriteComputerSettings (#1589) Based on @Doug-Lyons's patch. CORE-16067 --- dll/win32/syssetup/wizard.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/dll/win32/syssetup/wizard.c b/dll/win32/syssetup/wizard.c index 1e541da3f1..8422a9c9c6 100644 --- a/dll/win32/syssetup/wizard.c +++ b/dll/win32/syssetup/wizard.c @@ -534,6 +534,8 @@ WriteComputerSettings(WCHAR * ComputerName, HWND hwndDlg) { WCHAR Title[64]; WCHAR ErrorComputerName[256]; + LONG lError; + HKEY hKey = NULL; if (!SetComputerNameW(ComputerName)) { @@ -560,6 +562,31 @@ WriteComputerSettings(WCHAR * ComputerName, HWND hwndDlg) /* Set the accounts domain name */ SetAccountsDomainSid(NULL, ComputerName); + /* Now we need to set the Hostname */ + lError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters", + 0, + KEY_SET_VALUE, + &hKey); + if (lError != ERROR_SUCCESS) + { + DPRINT1("RegOpenKeyExW for Tcpip\\Parameters failed (%08lX)\n", lError); + return TRUE; + } + + lError = RegSetValueEx(hKey, + L"Hostname", + 0, + REG_SZ, + (LPBYTE)ComputerName, + (wcslen(ComputerName) + 1) * sizeof(WCHAR)); + if (lError != ERROR_SUCCESS) + { + DPRINT1("RegSetValueEx(\"Hostname\") failed (%08lX)\n", lError); + } + + RegCloseKey(hKey); + return TRUE; }
5 years, 6 months
1
0
0
0
[reactos] 01/01: [NET] Fix remaining issues with logon hours.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d0d7c5f045e0d6e0804e9…
commit d0d7c5f045e0d6e0804e9e69650ef39083acdbdf Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Tue May 28 17:23:43 2019 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Tue May 28 17:23:43 2019 +0200 [NET] Fix remaining issues with logon hours. --- base/applications/network/net/cmdUser.c | 40 +++++++++++++++++---------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/base/applications/network/net/cmdUser.c b/base/applications/network/net/cmdUser.c index 1ce735ee6f..4530e28e2e 100644 --- a/base/applications/network/net/cmdUser.c +++ b/base/applications/network/net/cmdUser.c @@ -909,6 +909,24 @@ ParseDay( } +static +DWORD +LocalToGmtHour( + LONG lLocalHour, + LONG lBias) +{ + LONG lGmtHour; + + lGmtHour = lLocalHour + lBias; + if (lGmtHour < 0) + lGmtHour += UNITS_PER_WEEK; + else if (lGmtHour > UNITS_PER_WEEK) + lGmtHour -= UNITS_PER_WEEK; + + return (DWORD)lGmtHour; +} + + static DWORD ParseLogonHours( @@ -1018,14 +1036,7 @@ ParseLogonHours( break; } - /* Convert from local timezone to GMT */ - lStartHour += lBias; - if (lStartHour < 0) - lStartHour += UNITS_PER_WEEK; - else if (lStartHour > UNITS_PER_WEEK) - lStartHour -= UNITS_PER_WEEK; - - SetBitValue(HourBitmap, (DWORD)lStartHour); + SetBitValue(HourBitmap, LocalToGmtHour(lStartHour, lBias)); } else { @@ -1051,19 +1062,10 @@ ParseLogonHours( break; } - if (lEndHour < lStartHour) + if (lEndHour <= lStartHour) lEndHour += HOURS_PER_DAY; - else if (lEndHour == lStartHour) - lEndHour = lStartHour + HOURS_PER_DAY; - - /* Convert from local timezone to GMT */ - lEndHour += lBias; - if (lEndHour < 0) - lEndHour += UNITS_PER_WEEK; - else if (lEndHour > UNITS_PER_WEEK) - lEndHour -= UNITS_PER_WEEK; - for (i = (DWORD)lStartHour; i < (DWORD)lEndHour; i++) + for (i = LocalToGmtHour(lStartHour, lBias); i < LocalToGmtHour(lEndHour, lBias); i++) SetBitValue(HourBitmap, i); } else
5 years, 7 months
1
0
0
0
[reactos] 01/01: [NET] Load the names of the days of week for the 'times' parser routine from the netmsg.dll.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=df31f870c8762d26e7f27…
commit df31f870c8762d26e7f275e9badbe392e584ea57 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Tue May 28 08:27:23 2019 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Tue May 28 08:27:23 2019 +0200 [NET] Load the names of the days of week for the 'times' parser routine from the netmsg.dll. --- base/applications/network/net/cmdUser.c | 82 +++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 20 deletions(-) diff --git a/base/applications/network/net/cmdUser.c b/base/applications/network/net/cmdUser.c index dc7527845c..1ce735ee6f 100644 --- a/base/applications/network/net/cmdUser.c +++ b/base/applications/network/net/cmdUser.c @@ -50,8 +50,6 @@ static COUNTRY_TABLE CountryTable[] = {785, 5103}, // Arabic {972, 5104} }; // Hebrew -//static PWSTR DaysArray[] = {L"So", L"Mo", L"Di", L"Mi", L"Do", L"Fr", L"Sa"}; -static PWSTR DaysArray[] = {L"Sun", L"Mon", L"Tue", L"Wed", L"Thu", L"Fri", L"Sat"}; static int @@ -837,6 +835,7 @@ static BOOL ParseHour( PWSTR pszString, + PWSTR *AmPmArray, PLONG plHour) { PWCHAR pChar; @@ -862,14 +861,14 @@ ParseHour( (lHour >= 1) && (lHour <= 12)) { - if ((_wcsicmp(pChar, L"am") == 0) || - (_wcsicmp(pChar, L"a.m.") == 0)) + if ((_wcsicmp(pChar, AmPmArray[0]) == 0) || + (_wcsicmp(pChar, AmPmArray[1]) == 0)) { if (lHour == 12) lHour = 0; } - else if ((_wcsicmp(pChar, L"pm") == 0) || - (_wcsicmp(pChar, L"p.m.") == 0)) + else if ((_wcsicmp(pChar, AmPmArray[2]) == 0) || + (_wcsicmp(pChar, AmPmArray[3]) == 0)) { if (lHour != 12) lHour += 12; @@ -890,13 +889,16 @@ static BOOL ParseDay( PWSTR pszString, + PWSTR *ShortDays, + PWSTR *LongDays, PDWORD pdwDay) { DWORD i; - for (i = 0; i < ARRAYSIZE(DaysArray); i++) + for (i = 0; i < 7; i++) { - if (_wcsicmp(pszString, DaysArray[i]) == 0) + if (_wcsicmp(pszString, ShortDays[i]) == 0 || + _wcsicmp(pszString, LongDays[i]) == 0) { *pdwDay = i; return TRUE; @@ -924,6 +926,9 @@ ParseLogonHours( LONG lStartHour, lEndHour, lBias; BYTE DayBitmap; BYTE HourBitmap[6]; + LPWSTR ShortDays[7] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL}; + LPWSTR LongDays[7] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL}; + LPWSTR AmPmArray[4] = {NULL, NULL, NULL, NULL}; GetTimeZoneInformation(&TimeZoneInformation); lBias = TimeZoneInformation.Bias / 60; @@ -945,6 +950,42 @@ ParseLogonHours( goto done; } + for (i = 0; i < 7; i++) + { + FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_HMODULE | + FORMAT_MESSAGE_IGNORE_INSERTS, + hModuleNetMsg, + 4314 + i, + LANG_USER_DEFAULT, + (LPWSTR)&ShortDays[i], + 0, + NULL); + + FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_HMODULE | + FORMAT_MESSAGE_IGNORE_INSERTS, + hModuleNetMsg, + 4307 + i, + LANG_USER_DEFAULT, + (LPWSTR)&LongDays[i], + 0, + NULL); + } + + for (i = 0; i < 4; i++) + { + FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_HMODULE | + FORMAT_MESSAGE_IGNORE_INSERTS, + hModuleNetMsg, + 4322 + i, + LANG_USER_DEFAULT, + (LPWSTR)&AmPmArray[i], + 0, + NULL); + } + ZeroMemory(&DayBitmap, sizeof(DayBitmap)); ZeroMemory(HourBitmap, sizeof(HourBitmap)); @@ -971,7 +1012,7 @@ ParseLogonHours( if (iswdigit(szBuffer[0])) { /* Parse hour */ - if (!ParseHour(szBuffer, &lStartHour)) + if (!ParseHour(szBuffer, AmPmArray, &lStartHour)) { dwError = 3769; break; @@ -989,7 +1030,7 @@ ParseLogonHours( else { /* Parse day */ - if (!ParseDay(szBuffer, &dwStartDay)) + if (!ParseDay(szBuffer, ShortDays, LongDays, &dwStartDay)) { dwError = 3768; break; @@ -1004,7 +1045,7 @@ ParseLogonHours( if (iswdigit(szBuffer[0])) { /* Parse hour */ - if (!ParseHour(szBuffer, &lEndHour)) + if (!ParseHour(szBuffer, AmPmArray, &lEndHour)) { dwError = 3769; break; @@ -1028,7 +1069,7 @@ ParseLogonHours( else { /* Parse day */ - if (!ParseDay(szBuffer, &dwEndDay)) + if (!ParseDay(szBuffer, ShortDays, LongDays, &dwEndDay)) { dwError = 3768; break; @@ -1072,17 +1113,18 @@ ParseLogonHours( ptr1++; } -#if 0 - printf("LogonBitmap:\n"); - for (i = 0; i < DAYS_PER_WEEK; i++) +done: + for (i = 0; i < 7; i++) { - j = i * 3; - printf("%lu: %02x%02x%02x\n", i, pLogonHours[j + 2], pLogonHours[j + 1], pLogonHours[j + 0]); + LocalFree(ShortDays[i]); + LocalFree(LongDays[i]); + } + + for (i = 0; i < 4; i++) + { + LocalFree(AmPmArray[i]); } - printf("\n"); -#endif -done: if (dwError == ERROR_SUCCESS) { *ppLogonBitmap = pLogonBitmap;
5 years, 7 months
1
0
0
0
[reactos] 01/01: [NET] Fix the timezone issue in the logon hours parser and display code of the USER command.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e5b635ed10d31f9d47d1a…
commit e5b635ed10d31f9d47d1ad1a4174e358b8d61c17 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Mon May 27 17:00:56 2019 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Mon May 27 17:00:56 2019 +0200 [NET] Fix the timezone issue in the logon hours parser and display code of the USER command. --- base/applications/network/net/cmdUser.c | 111 ++++++++++++++++---------------- 1 file changed, 56 insertions(+), 55 deletions(-) diff --git a/base/applications/network/net/cmdUser.c b/base/applications/network/net/cmdUser.c index 919a919caf..dc7527845c 100644 --- a/base/applications/network/net/cmdUser.c +++ b/base/applications/network/net/cmdUser.c @@ -262,8 +262,12 @@ PrintLogonHours( INT nPaddedLength) { DWORD dwUnitsPerDay, dwBitNumber, dwSecondsPerUnit; - DWORD dwStartTime, dwEndTime, dwStartDay, dwEndDay; + DWORD dwStartTime, dwEndTime, dwStartDay, dwEndDay, dwBias; BOOL bBitValue, bFirst = TRUE; + TIME_ZONE_INFORMATION TimeZoneInformation; + + GetTimeZoneInformation(&TimeZoneInformation); + dwBias = (TimeZoneInformation.Bias / 60) * SECONDS_PER_HOUR; if ((dwUnitsPerWeek == 0) || ((dwUnitsPerWeek %7) != 0)) @@ -309,8 +313,8 @@ PrintLogonHours( PrintMessageString(4307 + dwStartDay); ConPuts(StdOut, L" "); - // FIXME: Check if this is a converion from GMT to local timezone - PrintLocalTime((dwStartTime % SECONDS_PER_DAY) + SECONDS_PER_HOUR); + /* Convert from GMT to local timezone */ + PrintLocalTime((dwStartTime % SECONDS_PER_DAY) - dwBias); ConPrintf(StdOut, L" - "); if (dwStartDay != dwEndDay) @@ -319,8 +323,8 @@ PrintLogonHours( ConPuts(StdOut, L" "); } - // FIXME: Check if this is a converion from GMT to local timezone - PrintLocalTime((dwEndTime % SECONDS_PER_DAY) + SECONDS_PER_HOUR); + /* Convert from GMT to local timezone */ + PrintLocalTime((dwEndTime % SECONDS_PER_DAY) - dwBias); ConPuts(StdOut, L"\n"); } @@ -833,10 +837,10 @@ static BOOL ParseHour( PWSTR pszString, - PDWORD pdwHour) + PLONG plHour) { PWCHAR pChar; - DWORD dwHour = 0; + LONG lHour = 0; if (!iswdigit(pszString[0])) return FALSE; @@ -844,31 +848,31 @@ ParseHour( pChar = pszString; while (iswdigit(*pChar)) { - dwHour = dwHour * 10 + *pChar - L'0'; + lHour = lHour * 10 + *pChar - L'0'; pChar++; } - if (dwHour > 24) + if (lHour > 24) return FALSE; - if (dwHour == 24) - dwHour = 0; + if (lHour == 24) + lHour = 0; if ((*pChar != UNICODE_NULL) && - (dwHour >= 1) && - (dwHour <= 12)) + (lHour >= 1) && + (lHour <= 12)) { if ((_wcsicmp(pChar, L"am") == 0) || (_wcsicmp(pChar, L"a.m.") == 0)) { - if (dwHour == 12) - dwHour = 0; + if (lHour == 12) + lHour = 0; } else if ((_wcsicmp(pChar, L"pm") == 0) || (_wcsicmp(pChar, L"p.m.") == 0)) { - if (dwHour != 12) - dwHour += 12; + if (lHour != 12) + lHour += 12; } else { @@ -876,7 +880,7 @@ ParseHour( } } - *pdwHour = dwHour; + *plHour = lHour; return TRUE; } @@ -910,15 +914,20 @@ ParseLogonHours( PBYTE *ppLogonBitmap, PDWORD pdwUnitsPerWeek) { + TIME_ZONE_INFORMATION TimeZoneInformation; PBYTE pLogonBitmap = NULL; DWORD dwError = ERROR_SUCCESS; WCHAR szBuffer[32]; PWSTR ptr1, ptr2; WCHAR prevSep, nextSep; - DWORD dwStartHour, dwEndHour, dwStartDay, dwEndDay, i, j; + DWORD dwStartDay, dwEndDay, i, j; + LONG lStartHour, lEndHour, lBias; BYTE DayBitmap; BYTE HourBitmap[6]; + GetTimeZoneInformation(&TimeZoneInformation); + lBias = TimeZoneInformation.Bias / 60; + pLogonBitmap = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, UNITS_PER_WEEK / 8); @@ -956,33 +965,30 @@ ParseLogonHours( prevSep = nextSep; nextSep = *ptr1; -// printf("Token: '%S'\n", szBuffer); - if (*ptr1 != UNICODE_NULL) - printf("Separator: '%C'\n", *ptr1); - if (prevSep != L'-') { - // Set first value + /* Set first value */ if (iswdigit(szBuffer[0])) { - // parse hour - if (!ParseHour(szBuffer, &dwStartHour)) + /* Parse hour */ + if (!ParseHour(szBuffer, &lStartHour)) { dwError = 3769; break; } - // FIXME: Check if this is a converion from local timezone to GMT - if (dwStartHour > 0) - dwStartHour--; - else - dwStartHour = UNITS_PER_WEEK - 1; + /* Convert from local timezone to GMT */ + lStartHour += lBias; + if (lStartHour < 0) + lStartHour += UNITS_PER_WEEK; + else if (lStartHour > UNITS_PER_WEEK) + lStartHour -= UNITS_PER_WEEK; - SetBitValue(HourBitmap, dwStartHour); + SetBitValue(HourBitmap, (DWORD)lStartHour); } else { - // parse day + /* Parse day */ if (!ParseDay(szBuffer, &dwStartDay)) { dwError = 3768; @@ -994,33 +1000,34 @@ ParseLogonHours( } else { - // Set second value + /* Set second value */ if (iswdigit(szBuffer[0])) { - // parse hour - if (!ParseHour(szBuffer, &dwEndHour)) + /* Parse hour */ + if (!ParseHour(szBuffer, &lEndHour)) { dwError = 3769; break; } - if (dwEndHour < dwStartHour) - dwEndHour += HOURS_PER_DAY; - else if (dwEndHour == dwStartHour) - dwEndHour = dwStartHour + HOURS_PER_DAY; + if (lEndHour < lStartHour) + lEndHour += HOURS_PER_DAY; + else if (lEndHour == lStartHour) + lEndHour = lStartHour + HOURS_PER_DAY; - // FIXME: Check if this is a converion from local timezone to GMT - if (dwEndHour > 0) - dwEndHour--; - else - dwEndHour = UNITS_PER_WEEK - 1; + /* Convert from local timezone to GMT */ + lEndHour += lBias; + if (lEndHour < 0) + lEndHour += UNITS_PER_WEEK; + else if (lEndHour > UNITS_PER_WEEK) + lEndHour -= UNITS_PER_WEEK; - for (i = dwStartHour; i < dwEndHour; i++) + for (i = (DWORD)lStartHour; i < (DWORD)lEndHour; i++) SetBitValue(HourBitmap, i); } else { - // parse day + /* Parse day */ if (!ParseDay(szBuffer, &dwEndDay)) { dwError = 3768; @@ -1037,10 +1044,7 @@ ParseLogonHours( if (*ptr1 == L';' || *ptr1 == UNICODE_NULL) { - // Process the data -// printf("DayBitmap: %02x HourBitmap: %02x%02x%02x%02x%02x%02x\n", -// DayBitmap, HourBitmap[5], HourBitmap[4], HourBitmap[3], HourBitmap[2], HourBitmap[1], HourBitmap[0]); - + /* Fill the logon hour bitmap */ for (i = 0; i < DAYS_PER_WEEK; i++) { if (GetBitValue(&DayBitmap, i)) @@ -1053,16 +1057,13 @@ ParseLogonHours( } } - // Reset the Bitmaps + /* Reset the Bitmaps */ ZeroMemory(&DayBitmap, sizeof(DayBitmap)); ZeroMemory(HourBitmap, sizeof(HourBitmap)); } if (*ptr1 == UNICODE_NULL) - { -// printf("Done\n"); break; - } ZeroMemory(szBuffer, sizeof(szBuffer)); ptr2 = szBuffer;
5 years, 7 months
1
0
0
0
[reactos] 04/04: [TELNET] Add missing curly braces to for-statement
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=194180b1be60d959c7e14…
commit 194180b1be60d959c7e14a92dd2ef6cbe1061354 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Apr 28 17:22:34 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon May 27 13:54:08 2019 +0200 [TELNET] Add missing curly braces to for-statement Fixes GCC 8 warning: base/applications/network/telnet/src/tnmain.cpp:171:8: error: this 'for' clause does not guard... [-Werror=misleading-indentation] for (j = cursor; j >= 0; j--) ^~~ base/applications/network/telnet/src/tnmain.cpp:174:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for' for (k = --j; k >= 0; k--) ^~~ --- base/applications/network/telnet/src/tnmain.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/base/applications/network/telnet/src/tnmain.cpp b/base/applications/network/telnet/src/tnmain.cpp index 25bf556914..41541a8bb5 100644 --- a/base/applications/network/telnet/src/tnmain.cpp +++ b/base/applications/network/telnet/src/tnmain.cpp @@ -168,14 +168,18 @@ struct cmdHistory * cfgets (char *buf, unsigned int length, struct cmdHistory *c if(InputRecord.Event.KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) { int j, k; - for (j = cursor; j >= 0; j--) - if (buf[j-1] != ' ') - break; - for (k = --j; k >= 0; k--) - if (buf[k] == ' ' || k == 0) { - cursor = !k ? k : ++k; - break; - } + for (j = cursor; j >= 0; j--) + { + if (buf[j - 1] != ' ') + break; + for (k = --j; k >= 0; k--) + { + if (buf[k] == ' ' || k == 0) { + cursor = !k ? k : ++k; + break; + } + } + } } else cursor--; MustRefresh = 1;
5 years, 7 months
1
0
0
0
← Newer
1
2
3
4
5
...
17
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Results per page:
10
25
50
100
200