이전 장에서 나온 인자에 대하여 간단하게 설명을 추가하도록 한다.
        (1)서비스 이름,
        (2)서비스 표시 이름,
        (3)서비스 액세스 권한,
        (4)서버스 타입,
        (5)서비스 시작 타입,
        (6)서비스 에러 제어,
        (7)서비스 파일 경로,
        (8)서비스의 세부 설명

대략 살펴보아야 할 인자에 대하여 번호를 붙혀두었다. 그림을 보면서 살펴보자.

서비스 관리자에 나오는 화면을 캡처하고, 인자 번호를 부여하여 보았다. 구지 추가 적인 설명을
달지 않더라도 어떤 의미인지 확실하게 이해할 수 있을거라 생각한다.
 
나머지 인자에 대한 설명을 달아보자.

(3)서비스 액세스 권한 - 말 그대로 서비스를 핸들링할 수 있는 세부 권한을 말한다.
  별일 없으면 그냥 SERVICE_ALL_ACCESS 때려 넣는다.

더보기
SERVICE_ALL_ACCESS (0xF01FF) Includes STANDARD_RIGHTS_REQUIRED in addition to all access rights in this table.
SERVICE_CHANGE_CONFIG (0x0002) Required to call the ChangeServiceConfig or ChangeServiceConfig2 function to change the service configuration. Because this grants the caller the right to change the executable file that the system runs, it should be granted only to administrators.
SERVICE_ENUMERATE_DEPENDENTS (0x0008) Required to call the EnumDependentServices function to enumerate all the services dependent on the service.
SERVICE_INTERROGATE (0x0080) Required to call the ControlService function to ask the service to report its status immediately.
SERVICE_PAUSE_CONTINUE (0x0040) Required to call the ControlService function to pause or continue the service.
SERVICE_QUERY_CONFIG (0x0001) Required to call the QueryServiceConfig and QueryServiceConfig2 functions to query the service configuration.
SERVICE_QUERY_STATUS (0x0004) Required to call the QueryServiceStatusEx function to ask the service control manager about the status of the service.
SERVICE_START (0x0010) Required to call the StartService function to start the service.
SERVICE_STOP (0x0020) Required to call the ControlService function to stop the service.
SERVICE_USER_DEFINED_CONTROL(0x0100) Required to call the ControlService function to specify a user-defined control code.

(4)서버스 타입 - 윈도우즈에서 말하는 서비스라는건 여러가지 의미로 사용되는데 여기서는 현재 설치하려는 무언가가
  무엇인지를 알려주어야 한다. 파일시스템 드라이버(SERVICE_FILE_SYSTEM_DRIVER) 일 수도 있고,
  디바이스 드라이버(SERVICE_KERNEL_DRIVER) 일 수 도 있으며 지금 만들려고 하는 일반 응용프로그램
  수준의 서비스 프로그램(SERVICE_WIN32_OWN_PROCESS) 일 수 도 있다.

(6)서비스 에러 제어 - 만약 시스템 초기에 서비스가 구동하다가 에러가 발생하면 어떻게 할것인가? 에러난 서비스가 파일    시스템  이라면? 키보드 드라이버라면? 내가 만든 간단한 응용 서비스라면? 과 같이.. 서비스의 특성과 중요도에 따라,
  재부팅을 할 수도, 그냥 무시( SERVICE_ERROR_IGNORE) 할 수도 있다.

더보기
SERVICE_ERROR_CRITICAL
0x00000003
The startup program logs the error in the event log, if possible. If the last-known-good configuration is being started, the startup operation fails. Otherwise, the system is restarted with the last-known good configuration.
SERVICE_ERROR_IGNORE
0x00000000
The startup program ignores the error and continues the startup operation.
SERVICE_ERROR_NORMAL
0x00000001
The startup program logs the error in the event log but continues the startup operation.
SERVICE_ERROR_SEVERE
0x00000002
The startup program logs the error in the event log. If the last-known-good configuration is being started, the startup operation continues. Otherwise, the system is restarted with the last-known-good configuration.

아무것도 없는, 서비스 인스톨 함수 딸랑 하나 있는 Windows Console Application 이다.
아래 샘플 소스에 하나씩 하나씩 추가하여 간단한 서비스를 만들어 보도록 하자.

TestService.zip
0.01MB

+ Recent posts