Permalink
Browse files

add procedure init() in Service.pas

  • Loading branch information...
1 parent 1722db6 commit ff6a4c3f52049fc9fc5e4161880c4fd0b0130c91 @sunliming committed May 25, 2012
Showing with 46 additions and 0 deletions.
  1. +46 −0 Service.pas
View
@@ -2,6 +2,52 @@
interface
+uses windows;
+
+
+procedure ServiceMain;
+
implementation
+const
+ SERVICE_WIN32_OWN_PROCESS = $00000010;
+ SERVICE_STOPPED = $00000001;
+ SERVICE_ACCEPT_STOP = $00000001;
+
+type
+ TServiceStatus = record
+ dwServiceType: DWORD;
+ dwCurrentState: DWORD;
+ dwControlsAccepted: DWORD;
+ dwWin32ExitCode: DWORD;
+ dwServiceSpecificExitCode: DWORD;
+ dwCheckPoint: DWORD;
+ dwWaitHint: DWORD;
+ end;
+
+ SERVICE_STATUS_HANDLE = THandle;
+
+var
+ hServiceStatus: SERVICE_STATUS_HANDLE;
+ status: TServiceStatus;
+
+//*********************************************************
+// ³õʼ»¯º¯Êý
+//*********************************************************
+procedure Init;
+begin
+ hServiceStatus := 0;
+ status.dwServiceType := SERVICE_WIN32_OWN_PROCESS;
+ status.dwCurrentState := SERVICE_STOPPED;
+ status.dwControlsAccepted := SERVICE_ACCEPT_STOP;
+ status.dwWin32ExitCode := 0;
+ status.dwServiceSpecificExitCode := 0;
+ status.dwCheckPoint := 0;
+ status.dwWaitHint := 0;
+end;
+
+procedure ServiceMain;
+begin
+end;
+
end.

0 comments on commit ff6a4c3

Please sign in to comment.