6N1      !"#$%&'()*+,-./0 Safe1 Suppress the 2 value of an 3 taken from the errors package1456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./11SafeTThe control codes the service accepts and processes in its handler function (See HandlerFunction*). By default, all services accept the  INTERROGATE value. To accept the  DEVICEEVENTN value, the service must register to receive device events by using the registerDeviceNotification function.The service is a network component that can accept changes in its binding without being stopped and restarted. This control code allows the service to receive  NETBINDADD,  NETBINDREMOVE,  NETBINDENABLE , and NETBINDDISABLE notifications.The service can reread its startup parameters without being stopped and restarted. This control code allows the service to receive  PARAMCHANGE notifications.\The service can be paused and continued. This control code allows the service to receive PAUSE and CONTINUE notifications.MSDN documentation says that this function is not supported on Windows Server 2003 or Windows XP/2000. The support status on other versions is unknown to me._The service can perform preshutdown tasks. This control code enables the service to receive  PRESHUTDOWN9 notifications. Note that only the system can send it.hThe service is notified when system shutdown occurs. This control code allows the service to receive SHUTDOWN9 notifications. Note that only the system can send it.OThe service can be stopped. This control code allows the service to receive STOP notifications.0This function takes a q} and assumes it is a flagfield. Each bit is masked off and converted into a value. Any failures are silently discarded.1234506 121234506SafexA SERVICE_CONTROL is used in Handler functions. All control codes are defined here, but some can only be used with a  HandlerEx callback. Use convertSuccess to translate from a  to a q . Use convertAttempt to translate from a q to a . 789:; 78:  789:;SafeThe current state of a service.<=>?@ <?@<=>?@SafeXWin32 defines many types of services, but this binding only supports WIN32_OWN_PROCESS.$The service is a file system driver.The service is a device driver. $The service runs in its own process.!1The service shares a process with other services."Do no write your own services of this type. Windows Vista and above prevent service processes from directly interacting with users.A " is either a   or a !g running in the context of the LocalSystem account which is allowed to directly interact with users.  !"ABCD !"CD !"ABCDSafe#*Contains status information for a service.%LThe type of service. This binding only supports the WIN32_OWN_PROCESS type.&!The current state of the service.'See  for details on this field.(The error code the service uses to report an error that occurs when it is starting or stopping. To return an error code specific to the service, the service must set this value to  to indicate that the )I member contains the error code. The service should set this value to 1 when it is running and on normal termination.)A service-specific error code that the service returns when an error occurs while the service is starting or stopping. This value is ignored unless the ( member is set to .;This binding does not support service-specific error codes.*6The check-point value the service increments periodically to report its progress during a lengthy start, stop, pause, or continue operation. For example, the service should increment this value as it completes each step of its initialization when it is starting up. The user interface program that invoked the operation on the service uses this value to track the progress of the service during a lengthy operation. This value is not valid and should be zero when the service does not have a start, stop, pause, or continue operation pending.+'The estimated time required for a pending start, stop, pause, or continue operation, in milliseconds. Before the specified amount of time has elapsed, the service should make its next call to the SetServiceStatus function with either an incremented dwCheckPoint value or a change in &(. If the amount of time specified by + passes, and * has not been incremented or &v has not changed, the service control manager or service control program can assume that an error has occurred and the service should be stopped. However, if the service shares a process with other services, the service control manager cannot terminate the service application because it would have to terminate the other services sharing the process as well.#$%&'()*+EFGHIJKL#$%&'()*+EFGHIJK #$%&'()*+EFGHIJKLSafeMNOPMNOPMNOP SafeQRSTUVQRSTUQRSTUV SafeWXYZ[\WXYZ[\WXYZ[\Safe,The service dispatcher thread will call each function of this type that you provide. The first argument will be the name of the service. Any additional command-line parameters will appear in the second argument.$Each of these functions should call registerServiceCtrlHandlerf to register a function to handle incoming commands. It should then set the service's status to , and specify that no controls will be accepted. At this point the function may perform any other initialization steps before setting the service's status to -. All of this should take no more than 100ms.-NA handler function is registered with the service dispatcher thread from a ,. The first argument is a  returned from calling registerServiceCtrlHandlerZ. The second argument represents the command this service has been directed to perform..6Retrieves the current status of the specified service.]kRegister an handler function to be called whenever the operating system receives service control messages./RUpdates the service control manager's status information for the calling service.0Register a callback function to initialize the service, which will be called by the operating system immediately. startServiceCtrlDispatcher will block until the provided callback function returns.MSDN documentation: Connects the main thread of a service process to the service control manager, which causes the thread to be the service control dispatcher thread for the calling process.,-.MSDN documentation: A handle to the service. This handle is returned by the OpenService or the CreateService function, and it must have the SERVICE_QUERY_STATUS access right. For more information, see Service Security and Access Rights.UThis function will raise an exception if the Win32 call returned an error condition.]The name of the service. According to MSDN documentation this argument is unused in WIN32_OWN_PROCESS type services, which is the only type supported by this binding. Even so, it is recommended that the name of the service be used.MSDN description: The name of the service run by the calling thread. This is the service name that the service control program specified in the CreateService function when creating the service.vA Handler function to be called in response to service control messages. Behind the scenes this is translated into a  HandlerEx type handler.The returned handle may be used in calls to SetServiceStatus. For convenience Handler functions also receive a handle for the service./MSDN documentation: A handle to the status information structure for the current service. This handle is returned by the RegisterServiceCtrlHandlerEx function.MSDN documentation: A pointer to the SERVICE_STATUS structure the contains the latest status information for the calling service.UThis function will raise an exception if the Win32 call returned an error condition.0The name of the service. According to MSDN documentation this argument is unused in WIN32_OWN_PROCESS type services, which is the only type supported by this binding. Even so, it is recommended that the name of the service be used.MSDN description: The name of the service run by the calling thread. This is the service name that the service control program specified in the CreateService function when creating the service.This is a callback function that will be called by the operating system whenever the service is started. It should perform service initialization including the registration of a handler function. MSDN documentation gives conflicting advice as to whether this function should return before the service has entered the stopped state. In the official example the service main function blocks until the service is ready to stop.UAn exception will be raised if the underlying Win32 call returns an error condition.^_1  !"#$%&'()*+,-./01-, #$%&'()*+ !"./0,-.]/0^_`    !"#$%&'()*+,-../0123456789:;<=><=?<@ABCD<EF<EG<EH<EI<@JBCK<LM<LN<LO<LP<QR<QSTUVTUWTUXTUYTUZTU[TU\TU]TU^TU_TU`TUaTUbTUcTUdTUeTUfTUgTUhTUiTUjTUkTUlTUmTUnTUoTUpTUqTUrTUsTUtTUuTUvTUwTUxTUyTUzTU{TU|TU}TU~TUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTUTU<Q<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< < < < < <<<<<<<<<<<<<<<<<@<@ <@!<@"<Q#<Q$<Q%<Q&<Q'<Q(<Q)<Q*<L+<L,<L-<./<.0<.1<.2<.3<.4<.5<.6<.7<.8<.9<.:<.;<.<<.=<.><.?<.@<.A<.B<.C<.D<.E<.F<.G<.H<.I<.J<.K<.L<.MNOPQRSTUVQRSWRQXYQRZ[\]^_`abcdefg h h i j k l m n o p q rstuvWin32_HsxoCPgtjr49WESGjWh5qZ$System.Win32.SystemServices.ServicesImport3System.Win32.SystemServices.Services.SERVICE_ACCEPT4System.Win32.SystemServices.Services.SERVICE_CONTROL2System.Win32.SystemServices.Services.SERVICE_STATE1System.Win32.SystemServices.Services.SERVICE_TYPE3System.Win32.SystemServices.Services.SERVICE_STATUS*System.Win32.SystemServices.Services.Types8System.Win32.SystemServices.Services.SERVICE_TABLE_ENTRY(System.Win32.SystemServices.Services.RawSERVICE_ACCEPTACCEPT_NETBINDCHANGEACCEPT_PARAMCHANGEACCEPT_PAUSE_CONTINUEACCEPT_PRESHUTDOWNACCEPT_SHUTDOWN ACCEPT_STOPSERVICE_CONTROLCONTINUE INTERROGATE NETBINDADDNETBINDDISABLE NETBINDENABLE NETBINDREMOVE PARAMCHANGEPAUSE PRESHUTDOWNSHUTDOWNSTOP SERVICE_STATECONTINUE_PENDING PAUSE_PENDINGPAUSEDRUNNING START_PENDING STOP_PENDINGSTOPPEDnO_ERROReRROR_SERVICE_SPECIFIC_ERROR SERVICE_TYPEFILE_SYSTEM_DRIVER KERNEL_DRIVERWIN32_OWN_PROCESSWIN32_SHARE_PROCESSSERVICE_INTERACTIVE_PROCESSSERVICE_STATUS serviceType currentStatecontrolsAccepted win32ExitCodeserviceSpecificExitCode checkPointwaitHintServiceMainFunctionHandlerFunctionqueryServiceStatussetServiceStatusstartServiceCtrlDispatcherhushbase Data.EitherLeftEither GHC.Stable newStablePtrghc-prim GHC.TypesIntGHC.IntInt8Int16Int32Int64 StablePtrWordGHC.WordWord8Word16Word32Word64GHC.PtrPtrFunPtrWin32_9y3u0frE63H1E2HTZUjJ63System.Win32.TypesdwordsToDdwordddwordToDwordsfailWitherrorWinfailUnlessSuccessOrfailUnlessSuccess failIfFalse_ failIfZero failIfNullfailIf_failIfiNVALID_HANDLE_VALUEnullFinalHANDLE nullHANDLE handleToWordnewForeignHANDLE newTStringpeekTStringLen peekTStringwithTStringLen withTString numToMaybemaybeNum ptrToMaybemaybePtr c_maperrnodeleteObjectFinaliser localFree getLastErrorgetErrorMessagelOWORDhIWORDcastUINTPtrToPtrcastPtrToUINTPtrmAKELCIDlANGIDFROMLCIDsORTIDFROMLCID mAKELANGID pRIMARYLANGID sUBLANGIDBOOLBYTEUCHARUSHORTUINTINTWORDDWORDLONGFLOAT LARGE_INTEGERUINT_PTRDDWORDMbStringMbINTATOMWPARAMLPARAMLRESULTSIZE_TMbATOMHRESULTAddrLPVOIDLPBOOLLPBYTEPUCHARLPDWORDLPSTRLPCSTRLPWSTRLPCWSTRLPTSTRLPCTSTRLPCTSTR_MbLPVOIDMbLPCSTR MbLPCTSTRTCHARHANDLE ForeignHANDLEHKEYPKEYMbHANDLE HINSTANCE MbHINSTANCEHMODULE MbHMODULEErrCodeLCIDLANGIDSortID SubLANGID PrimaryLANGIDnullPtrGHC.ForeignPtr ForeignPtrForeign.Marshal.PoolpooledNewArray0pooledNewArray pooledNewpooledReallocArray0pooledReallocArraypooledMallocArray0pooledMallocArraypooledReallocBytes pooledReallocpooledMallocBytes pooledMallocwithPoolfreePoolnewPoolPoolForeign.Marshal.Errorvoid throwIfNull throwIfNeg_ throwIfNegthrowIf_throwIfForeign.Marshal.Array advancePtr lengthArray0 moveArray copyArray withArrayLen0 withArray0 withArrayLen withArray newArray0newArray pokeArray0 pokeArray peekArray0 peekArray reallocArray0 reallocArray allocaArray0 allocaArray callocArray0 callocArray mallocArray0 mallocArrayForeign.Marshal.Utils fillBytes moveBytes copyByteswithMany maybePeek maybeWithmaybeNewtoBoolfromBoolwithnewForeign.Marshal.Allocfree reallocBytesreallocallocaBytesAligned allocaBytesalloca callocBytes mallocBytescallocmalloc finalizerFreeForeign.ForeignPtr.ImpmallocForeignPtrArray0mallocForeignPtrArraynewForeignPtrEnvwithForeignPtr newForeignPtr Foreign.Ptr intPtrToPtr ptrToIntPtr wordPtrToPtr ptrToWordPtrfreeHaskellFunPtrWordPtrIntPtrfinalizeForeignPtrcastForeignPtrtouchForeignPtrnewForeignPtr_addForeignPtrFinalizerEnvaddForeignPtrFinalizermallocForeignPtrBytesmallocForeignPtr FinalizerPtrFinalizerEnvPtrForeign.Storablepokepeek pokeByteOff peekByteOff pokeElemOff peekElemOff alignmentsizeOfStorablecastPtrToStablePtrcastStablePtrToPtrdeRefStablePtr freeStablePtrcastPtrToFunPtrcastFunPtrToPtr castFunPtr nullFunPtrminusPtralignPtrplusPtrcastPtr byteSwap64 byteSwap32 byteSwap16 Data.BitstoIntegralSizedpopCountDefaulttestBitDefault bitDefaultpopCountrotateRrotateL unsafeShiftRshiftR unsafeShiftLshiftLisSignedbitSize bitSizeMaybetestBit complementBitclearBitsetBitbitzeroBitsrotateshift complementxor.|..&.BitscountTrailingZeroscountLeadingZeros finiteBitSize FiniteBitsunflagpeekServiceAcceptpokeServiceAccepttoDWORD fromDWORD unsupportedflagpeekServiceControlpokeServiceControleRROR_CALL_NOT_IMPLEMENTEDpeekServiceStatepokeServiceStatepeekServiceTypepokeServiceTypepSTpCSpCApECpSSECpCPpWH$fStorableSERVICE_STATUSLPSERVICE_MAIN_FUNCTIONSERVICE_MAIN_FUNCTIONLPHANDLER_FUNCTION_EXHANDLER_FUNCTION_EXSERVICE_TABLE_ENTRY serviceName serviceProcnullSTE$fStorableSERVICE_TABLE_ENTRYc_StartServiceCtrlDispatcherc_SetServiceStatusc_RegisterServiceCtrlHandlerExc_QueryServiceStatushandlerToFunPtr smfToFunPtrregisterServiceCtrlHandlerExtoSMF toHandlerEx