!H/      !"#$%&'()*+,-. Safe/Win32-services Suppress the 0 value of an 1 taken from the errors packageK23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{/SafeWin32-serviceswA ServiceControl 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 u . Use convertAttempt to translate from a u to a .|Win32-services2Marshal a ServiceAccept "out" to be used in C-land}Win32-servicesCMarshall a DWORD "in" to be used in Haskell-land as a ServiceAccept  ~}Safe, Win32-servicesTThe control codes the service accepts and processes in its handler function (See HandlerFunction*). By default, all services accept the  value. To accept the  DEVICEEVENTN value, the service must register to receive device events by using the registerDeviceNotification function. Win32-servicesThe 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 , , , and  notifications.Win32-servicesThe service can reread its startup parameters without being stopped and restarted. This control code allows the service to receive  notifications.Win32-services\The service can be paused and continued. This control code allows the service to receive  and  notifications.Win32-servicesMSDN 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 9 notifications. Note that only the system can send it.Win32-serviceshThe service is notified when system shutdown occurs. This control code allows the service to receive  9 notifications. Note that only the system can send it.Win32-servicesOThe service can be stopped. This control code allows the service to receive   notifications.Win32-services2Marshal a ServiceAccept "out" to be used in C-landWin32-servicesCMarshall a DWORD "in" to be used in Haskell-land as a ServiceAcceptWin32-servicesThis function takes a u} and assumes it is a flagfield. Each bit is masked off and converted into a value. Any failures are silently discarded. Safe0OWin32-servicesThe current state of a service.Win32-services]State is stored as a DWORD value in memory. If an undocument value is encountered during a L4, there isn't any reasonable way to respond, so an  ErrorCall exception will be thrown.Safe0 Safe:tWin32-servicesVWin32 defines many types of services, but this binding only supports Win32OwnProcess.Win32-services$The service is a file system driver.Win32-servicesThe service is a device driver.Win32-services$The service runs in its own process.Win32-services1The service shares a process with other services. Win32-servicesDo 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.  Safe]^!Win32-services*Contains status information for a service.#Win32-services4The type of service. This binding only supports the  type.$Win32-services!The current state of the service.%Win32-servicesSee   for details on this field.&Win32-servicesThe 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.'Win32-servicesA 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.(Win32-services6The 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.)Win32-services'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.!")('&%$# Safe]SafeJ*Win32-servicesThe 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.+Win32-servicesNA 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.,Win32-services6Retrieves the current status of the specified service.Win32-serviceskRegister an handler function to be called whenever the operating system receives service control messages.-Win32-servicesRUpdates the service control manager's status information for the calling service..Win32-servicesRegister 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.,Win32-servicesMSDN 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.Win32-servicesThis function will throw an  when the internal Win32 call returnes an error condition. MSDN lists the following exceptions, but others might be thrown as well: BThe handle does not have the SERVICE_QUERY_STATUS access right.The handle is invalid.Win32-servicesUThe name of the service. According to MSDN documentation this argument is unused in  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.Win32-servicesvA Handler function to be called in response to service control messages. Behind the scenes this is translated into a  HandlerEx type handler.Win32-servicesThis function will throw an  when the internal Win32 call returnes an error condition. MSDN lists the following exceptions, but others might be thrown as well: GThe service entry was specified incorrectly when the process called ..-Win32-servicesMSDN documentation: A handle to the status information structure for the current service. This handle is returned by the RegisterServiceCtrlHandlerEx function.Win32-servicesMSDN documentation: A pointer to the SERVICE_STATUS structure the contains the latest status information for the calling service.Win32-servicesThis function will throw an  when the internal Win32 call returnes an error condition. MSDN lists the following exceptions, but others might be thrown as well: 2The specified service status structure is invalid. The specified handle is invalid..Win32-servicesUThe name of the service. According to MSDN documentation this argument is unused in  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.Win32-services waitHintfThe estimated time required for a pending start, stop, pause, or continue operation, in milliseconds.Win32-servicesThis 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.Win32-servicesThis function will throw an  when the internal Win32 call returnes an error condition. MSDN lists the following exceptions, but others might be thrown as well: This error is returned if the program is being run as a console application rather than as a service. If the program will be run as a console application for debugging purposes, structure it such that service-specific code is not called when this error is returned.SThe specified dispatch table contains entries that are not in the proper format."The process has already called startServiceCtrlDispatcher. Each process can call startServiceCtrlDispatcher only one time./   !"#$%&'()*+,-./+*   !"#$%&'() ,-.   !"#$%& ' ( ) * + , - - . / 0 1 2 3 456789:;<=;<>;?@ABC;DE;DF;DG;DH;?IABJ;KL;KM;KN;KO;PQ;PRSTUSTVSTWSTXSTYSTZST[ST\ST]ST^ST_ST`STaSTbSTcSTdSTeSTfSTgSThSTiSTjSTkSTlSTmSTnSToSTpSTqSTrSTsSTtSTuSTvSTwSTxSTySTzST{ST|ST}ST~STSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTSTST;P;;;;;;; ; ; ; ; ;;;;;;;;;;;;;;;;;; ;!;";#;$;%;&;';(;);*+;*,;*-;*.;*/;*0;*1;*2;*3;*4;*5;67;68;69;6:;6;;6<;6=;6>;6?;6@;6A;BC;BD;BE;BF;BG;BH;IJ;IK;IL;IM;IN;O;P;Q;R;S;T;U;V;W;X;Y;Z[;Z\;Z];Z^;Z_;Z`;Z`;Za;Za;bc;bd;be;bf;bg;bh;bi;bj;bk;?l;?m;?n;?o;Pp;Pq;Pr;Ps;Pt;Pu;Pv;Pw;Kx;Ky;Kz;{|;{};{~;{;{;{;{;{;{;{;{;{;{;{;{;{;{;{;{;{;{;{;{;{;{;{;{;{;{;{;{              Win32-services-0.4-inplaceSystem.Win32.ServicesImportSystem.Win32.Services.ControlSystem.Win32.Services.AcceptC PreshutdownSystem.Win32.Services.State System.Win32.Services.TableEntrySystem.Win32.Services.TypeSystem.Win32.Services.StatusSystem.Win32.Services.RawServiceControlContinue Interrogate NetBindAddNetBindDisable NetBindEnable NetBindRemove ParamChangePause PreShutdownShutdownStop ServiceAcceptAcceptNetBindChangeAcceptParamChangeAcceptPauseContinueAcceptPreshutdownAcceptShutdown AcceptStop ServiceStateContinuePending PausePendingPausedRunning StartPending StopPendingStopped ServiceTypeFileSystemDriver KernelDriverWin32OwnProcessWin32ShareProcessServiceInteractiveProcess ServiceStatus serviceType currentStatecontrolsAccepted win32ExitCodeserviceSpecificExitCode checkPointwaitHintServiceMainFunctionHandlerFunctionqueryServiceStatussetServiceStatusstartServiceCtrlDispatcherhushbase Data.EitherLeftEither GHC.Stable newStablePtrghc-prim GHC.TypesIntGHC.IntInt8Int16Int32Int64 StablePtrWordGHC.WordWord8Word16Word32Word64GHC.PtrPtrFunPtr Win32-2.6.1.0System.Win32.TypestrydwordsToDdwordddwordToDwordseRROR_PROC_NOT_FOUNDeRROR_MOD_NOT_FOUNDeRROR_INSUFFICIENT_BUFFERfailUnlessSuccessOr failIfZero failIfNegfailIf_ withStablePtrwithHandleToHANDLEhANDLEToHandleiNVALID_HANDLE_VALUEnullFinalHANDLE nullHINSTANCE nullHANDLE handleToWordnewForeignHANDLE newTStringpeekTStringLen peekTStringwithTStringLen withTString numToMaybemaybeNum ptrToMaybemaybePtr_open_osfhandlec_get_osfhandlec_maperrno_funcdeleteObjectFinaliser localFree getLastError setLastErrorgetErrorMessagelOWORDhIWORDcastUINTPtrToPtrcastPtrToUINTPtrmAKELCIDlANGIDFROMLCIDsORTIDFROMLCID mAKELANGID pRIMARYLANGID sUBLANGIDBOOLBYTEUCHARUSHORTUINTINTWORDDWORDLONGFLOAT LARGE_INTEGERDWORD32DWORD64INT32INT64LONG32LONG64UINT32UINT64ULONG32ULONG64SHORT DWORD_PTRINT_PTRULONGUINT_PTRLONG_PTR ULONG_PTRHALF_PTRDDWORDMbStringMbINTATOMWPARAMLPARAMLRESULTSIZE_TMbATOMHRESULTAddrLPVOIDLPBOOLLPBYTEPUCHARLPDWORDLPSTRLPCSTRLPWSTRLPCWSTRLPTSTRLPCTSTRLPCTSTR_MbLPVOIDMbLPCSTR MbLPCTSTRTCHARHANDLE ForeignHANDLEHKEYPKEYMbHANDLE HINSTANCE MbHINSTANCEHMODULE MbHMODULELCIDLANGIDSortID SubLANGID PrimaryLANGIDnullPtr=Win32-errors-0.2.2.3-de3cf728d4af9c6dfd10490035afdd3d20f94407System.Win32.Error.ForeignfailWitherrorWinfailUnlessSuccess failIfNullfailIf failIfFalse_System.Win32.Error.TypestryWin32 fromDWORDWin32ExceptionfunctionerrCode systemMessagetoDWORDErrCodeInvalidHandleValueSuccess FileNotFound PathNotFound AccessDenied InvalidHandle InvalidData InvalidDriveCurrentDirectory NoMoreFilesCallNotImplementedMoreData NoMoreItemsServiceAlreadyRunningServiceDisabledServiceDoesNotExistServiceCannotAcceptCtrlServiceNotActiveFailedServiceControllerConnectExceptionInServiceServiceSpecificErrorServiceNotInExeRPCSServerUnavailableRPCSServerTooBusyNotAReparsePointDhcpSubnetNotPresentDhcpElementCantRemoveDhcpOptionNotPresent DhcpJetErrorDhcpNotReservedClientDhcpReservedClientDhcpIprangeExistsDhcpReservedipExistsDhcpInvalidRangeDhcpIprangeConvIllegalScopeRangePolicyRangeConflictDhcpFoIprangeTypeConvIllegalOtherGHC.ForeignPtr ForeignPtrForeign.Marshal.PoolpooledNewArray0pooledNewArray pooledNewpooledReallocArray0pooledReallocArraypooledMallocArray0pooledMallocArraypooledReallocBytes pooledReallocpooledMallocBytes pooledMallocwithPoolfreePoolnewPoolPoolForeign.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.Marshal.Errorvoid throwIfNull throwIfNeg_ throwIfNegthrowIf_throwIfForeign.ForeignPtr.ImpmallocForeignPtrArray0mallocForeignPtrArraynewForeignPtrEnvwithForeignPtr newForeignPtrfinalizeForeignPtrplusForeignPtrcastForeignPtrtouchForeignPtrnewForeignPtr_addForeignPtrFinalizerEnvaddForeignPtrFinalizermallocForeignPtrBytesmallocForeignPtr FinalizerPtrFinalizerEnvPtr Foreign.Ptr intPtrToPtr ptrToIntPtr wordPtrToPtr ptrToWordPtrfreeHaskellFunPtrWordPtrIntPtrForeign.StorableStorablesizeOf alignment peekElemOff pokeElemOff peekByteOff pokeByteOffpeekpokecastPtrToStablePtrcastStablePtrToPtrdeRefStablePtr freeStablePtrcastPtrToFunPtrcastFunPtrToPtr castFunPtr nullFunPtrminusPtralignPtrplusPtrcastPtr byteSwap64 byteSwap32 byteSwap16 Data.BitstoIntegralSizedpopCountDefaulttestBitDefault bitDefaultBits.&..|.xor complementshiftrotatezeroBitsbitsetBitclearBit complementBittestBit bitSizeMaybebitSizeisSignedshiftL unsafeShiftLshiftR unsafeShiftRrotateLrotateRpopCount FiniteBits finiteBitSizecountLeadingZeroscountTrailingZerosmarshOutmarshInpeekServiceControlpokeServiceControlunflagpeekServiceAcceptpokeServiceAccept$fStorableServiceStateServiceTableEntry serviceProc serviceNameSERVICE_MAIN_FUNCTIONnullSTEpCApSSECpCPpWHpSTpCSpECHANDLER_FUNCTION_EXc_StartServiceCtrlDispatcherc_SetServiceStatusc_RegisterServiceCtrlHandlerExc_QueryServiceStatushandlerToFunPtr smfToFunPtrregisterServiceCtrlHandlerEx