25#ifndef STANDALONE_NFSD
76 ((*
argv[1] ==
'-') || (*
argv[1] ==
'/')) )
105 printf(
"%s -debug <params> to run as a console app for debugging\n",
SZAPPNAME );
106 printf(
"\nStartServiceCtrlDispatcher being called.\n" );
107 printf(
"This may take several seconds. Please wait.\n" );
241 DWORD dwWin32ExitCode,
244 static DWORD dwCheckPoint = 1;
308 lpszStrings[0] = szMsg;
309 lpszStrings[1] = lpszMsg;
311 if (hEventSource !=
NULL)
352 SC_HANDLE schService;
353 SC_HANDLE schSCManager;
418 SC_HANDLE schService;
419 SC_HANDLE schSCManager;
504 if (
NULL == lpszArgv)
507 _tprintf(
TEXT(
"CmdDebugService CommandLineToArgvW returned NULL\n"));
546 switch ( dwCtrlType )
587 if ( !dwRet || ( (
long)
dwSize < (
long)dwRet+14 ) )
588 lpszBuf[0] =
TEXT(
'\0');
591 if (
NULL != lpszTemp)
602 if (
NULL != lpszTemp )
static SERVICE_STATUS_HANDLE(WINAPI *pRegisterServiceCtrlHandlerExA)(LPCSTR
void dispatch(HANDLE hStopEvent)
BOOL WINAPI ControlHandler(DWORD dwCtrlType)
BOOL ReportStatusToSCMgr(DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint)
VOID WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv)
VOID WINAPI service_ctrl(DWORD dwCtrlCode)
VOID AddToMessageLog(LPTSTR lpszMsg)
VOID CmdDebugService(int argc, char **argv)
LPTSTR GetLastErrorText(LPTSTR lpszBuf, DWORD dwSize)
SERVICE_STATUS_HANDLE sshStatusHandle
BOOL WINAPI DeregisterEventSource(IN HANDLE hEventLog)
static void cleanup(void)
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine, BOOL Add)
LPWSTR WINAPI GetCommandLineW(VOID)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
VOID ServiceStart(DWORD argc, LPTSTR *argv)
BOOL WINAPI QueryServiceStatus(SC_HANDLE hService, LPSERVICE_STATUS lpServiceStatus)
BOOL WINAPI DeleteService(SC_HANDLE hService)
BOOL WINAPI ControlService(SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
BOOL WINAPI SetServiceStatus(SERVICE_STATUS_HANDLE hServiceStatus, LPSERVICE_STATUS lpServiceStatus)
#define SZSERVICEDISPLAYNAME
LPWSTR *WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int *numargs)
DWORD dwServiceSpecificExitCode
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
DWORD WINAPI GetLastError(void)
#define FORMAT_MESSAGE_FROM_SYSTEM
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
#define FORMAT_MESSAGE_ARGUMENT_ARRAY
#define RegisterEventSource
#define GetModuleFileName
#define EVENTLOG_ERROR_TYPE
#define SERVICE_ACCEPT_STOP
#define SERVICE_QUERY_STATUS
#define SC_MANAGER_CREATE_SERVICE
#define SC_MANAGER_CONNECT
#define SERVICE_STOP_PENDING
#define StartServiceCtrlDispatcher
LPSERVICE_MAIN_FUNCTIONA LPSERVICE_MAIN_FUNCTION
#define SERVICE_START_PENDING
#define SERVICE_CONTROL_STOP
#define RegisterServiceCtrlHandler
#define SERVICE_CONTROL_INTERROGATE
#define SERVICE_AUTO_START
#define SERVICE_WIN32_OWN_PROCESS
#define SERVICE_ERROR_NORMAL