ifndef _LMSVC_
define _LMSVC_

include lmsname.inc

SERVICE_INFO_0		STRUC
svci0_name		LPWSTR ?
SERVICE_INFO_0		ENDS
PSERVICE_INFO_0		typedef ptr SERVICE_INFO_0
LPSERVICE_INFO_0	typedef ptr SERVICE_INFO_0

SERVICE_INFO_1		STRUC
svci1_name		LPWSTR ?
svci1_status		dd ?
svci1_code		dd ?
svci1_pid		dd ?
SERVICE_INFO_1		ENDS
PSERVICE_INFO_1		typedef ptr SERVICE_INFO_1
LPSERVICE_INFO_1	typedef ptr SERVICE_INFO_1

SERVICE_INFO_2		STRUC
svci2_name		LPWSTR ?
svci2_status		dd ?
svci2_code		dd ?
svci2_pid		dd ?
svci2_text		LPWSTR ?
svci2_specific_error	dd ?
svci2_display_name	LPWSTR ?
SERVICE_INFO_2		ENDS
PSERVICE_INFO_2		typedef ptr SERVICE_INFO_2
LPSERVICE_INFO_2	typedef ptr SERVICE_INFO_2

NetServiceControl proto WINAPI :LPCWSTR, :LPCWSTR, :DWORD, :DWORD, :ptr
NetServiceEnum proto WINAPI :LPCWSTR, :DWORD, :ptr, :DWORD, :LPDWORD, :LPDWORD, :LPDWORD
NetServiceGetInfo proto WINAPI :LPCWSTR, :LPCWSTR, :DWORD, :ptr
NetServiceInstall proto WINAPI :LPCWSTR, :LPCWSTR, :DWORD, :LPCWSTR, :ptr

SERVICE_INSTALL_STATE	equ 0x03
SERVICE_UNINSTALLED	equ 0x00
SERVICE_INSTALL_PENDING equ 0x01
SERVICE_UNINSTALL_PENDING equ 0x02
SERVICE_INSTALLED	equ 0x03

SERVICE_PAUSE_STATE	equ 0x0C
LM20_SERVICE_ACTIVE	equ 0x00
LM20_SERVICE_CONTINUE_PENDING equ 0x04
LM20_SERVICE_PAUSE_PENDING equ 0x08
LM20_SERVICE_PAUSED	equ 0x0C

SERVICE_NOT_UNINSTALLABLE equ 0x00
SERVICE_UNINSTALLABLE	equ 0x10

SERVICE_NOT_PAUSABLE	equ 0x00
SERVICE_PAUSABLE	equ 0x20

SERVICE_REDIR_PAUSED	equ 0x700
SERVICE_REDIR_DISK_PAUSED equ 0x100
SERVICE_REDIR_PRINT_PAUSED equ 0x200
SERVICE_REDIR_COMM_PAUSED equ 0x400

SERVICE_DOS_ENCRYPTION	equ <L"ENCRYPT">

SERVICE_CTRL_INTERROGATE equ 0
SERVICE_CTRL_PAUSE	equ 1
SERVICE_CTRL_CONTINUE	equ 2
SERVICE_CTRL_UNINSTALL	equ 3

SERVICE_CTRL_REDIR_DISK equ 0x1
SERVICE_CTRL_REDIR_PRINT equ 0x2
SERVICE_CTRL_REDIR_COMM equ 0x4

SERVICE_IP_NO_HINT	equ 0x0
SERVICE_CCP_NO_HINT	equ 0x0

SERVICE_IP_QUERY_HINT	equ 0x10000
SERVICE_CCP_QUERY_HINT	equ 0x10000

SERVICE_IP_CHKPT_NUM	equ 0x0FF
SERVICE_CCP_CHKPT_NUM	equ 0x0FF

SERVICE_IP_WAIT_TIME	equ 0x0FF00
SERVICE_CCP_WAIT_TIME	equ 0x0FF00

SERVICE_IP_WAITTIME_SHIFT equ 8
SERVICE_NTIP_WAITTIME_SHIFT equ 12

UPPER_HINT_MASK		equ 0x0000FF00
LOWER_HINT_MASK		equ 0x000000FF
UPPER_GET_HINT_MASK	equ 0x0FF00000
LOWER_GET_HINT_MASK	equ 0x0000FF00
SERVICE_NT_MAXTIME	equ 0x0000FFFF
SERVICE_RESRV_MASK	equ 0x0001FFFF
SERVICE_MAXTIME		equ 0x000000FF

SERVICE_BASE		equ 3050
SERVICE_UIC_NORMAL	equ 0

SERVICE_UIC_BADPARMVAL	equ (SERVICE_BASE + 1)
SERVICE_UIC_MISSPARM	equ (SERVICE_BASE + 2)
SERVICE_UIC_UNKPARM	equ (SERVICE_BASE + 3)
SERVICE_UIC_RESOURCE	equ (SERVICE_BASE + 4)
SERVICE_UIC_CONFIG	equ (SERVICE_BASE + 5)
SERVICE_UIC_SYSTEM	equ (SERVICE_BASE + 6)
SERVICE_UIC_INTERNAL	equ (SERVICE_BASE + 7)
SERVICE_UIC_AMBIGPARM	equ (SERVICE_BASE + 8)
SERVICE_UIC_DUPPARM	equ (SERVICE_BASE + 9)
SERVICE_UIC_KILL	equ (SERVICE_BASE + 10)
SERVICE_UIC_EXEC	equ (SERVICE_BASE + 11)
SERVICE_UIC_SUBSERV	equ (SERVICE_BASE + 12)
SERVICE_UIC_CONFLPARM	equ (SERVICE_BASE + 13)
SERVICE_UIC_FILE	equ (SERVICE_BASE + 14)

SERVICE_UIC_M_NULL	equ 0

SERVICE_UIC_M_MEMORY	equ (SERVICE_BASE + 20)
SERVICE_UIC_M_DISK	equ (SERVICE_BASE + 21)
SERVICE_UIC_M_THREADS	equ (SERVICE_BASE + 22)
SERVICE_UIC_M_PROCESSES equ (SERVICE_BASE + 23)

SERVICE_UIC_M_SECURITY	equ (SERVICE_BASE + 24)
SERVICE_UIC_M_LANROOT	equ (SERVICE_BASE + 25)
SERVICE_UIC_M_REDIR	equ (SERVICE_BASE + 26)
SERVICE_UIC_M_SERVER	equ (SERVICE_BASE + 27)
SERVICE_UIC_M_SEC_FILE_ERR equ (SERVICE_BASE + 28)
SERVICE_UIC_M_FILES	equ (SERVICE_BASE + 29)
SERVICE_UIC_M_LOGS	equ (SERVICE_BASE + 30)
SERVICE_UIC_M_LANGROUP	equ (SERVICE_BASE + 31)
SERVICE_UIC_M_MSGNAME	equ (SERVICE_BASE + 32)
SERVICE_UIC_M_ANNOUNCE	equ (SERVICE_BASE + 33)
SERVICE_UIC_M_UAS	equ (SERVICE_BASE + 34)
SERVICE_UIC_M_SERVER_SEC_ERR equ (SERVICE_BASE + 35)
SERVICE_UIC_M_WKSTA	equ (SERVICE_BASE + 37)
SERVICE_UIC_M_ERRLOG	equ (SERVICE_BASE + 38)
SERVICE_UIC_M_FILE_UW	equ (SERVICE_BASE + 39)
SERVICE_UIC_M_ADDPAK	equ (SERVICE_BASE + 40)
SERVICE_UIC_M_LAZY	equ (SERVICE_BASE + 41)
SERVICE_UIC_M_UAS_MACHINE_ACCT equ (SERVICE_BASE + 42)
SERVICE_UIC_M_UAS_SERVERS_NMEMB equ (SERVICE_BASE + 43)
SERVICE_UIC_M_UAS_SERVERS_NOGRP equ (SERVICE_BASE + 44)
SERVICE_UIC_M_UAS_INVALID_ROLE equ (SERVICE_BASE + 45)
SERVICE_UIC_M_NETLOGON_NO_DC equ (SERVICE_BASE + 46)
SERVICE_UIC_M_NETLOGON_DC_CFLCT equ (SERVICE_BASE + 47)
SERVICE_UIC_M_NETLOGON_AUTH equ (SERVICE_BASE + 48)
SERVICE_UIC_M_UAS_PROLOG equ (SERVICE_BASE + 49)

SERVICE2_BASE		equ 5600

SERVICE_UIC_M_NETLOGON_MPATH equ (SERVICE2_BASE + 0)
SERVICE_UIC_M_LSA_MACHINE_ACCT equ (SERVICE2_BASE + 1)
SERVICE_UIC_M_DATABASE_ERROR equ (SERVICE2_BASE + 2)

SERVICE_IP_CODE macro tt,nn
	exitm<(SERVICE_IP_QUERY_HINT OR (nn OR (tt SHL SERVICE_IP_WAITTIME_SHIFT)))>
	endm

SERVICE_CCP_CODE macro tt,nn
	exitm<(SERVICE_CCP_QUERY_HINT OR (nn OR (tt SHL SERVICE_IP_WAITTIME_SHIFT)))>
	endm

SERVICE_UIC_CODE macro cc,mm
	exitm<(((cc SHL 16) OR mm))>
	endm

SERVICE_NT_CCP_CODE macro tt,nn
	exitm<((SERVICE_CCP_QUERY_HINT) OR (nn) OR (((tt) AND LOWER_HINT_MASK) SHL SERVICE_IP_WAITTIME_SHIFT) (((tt) AND UPPER_HINT_MASK) SHL SERVICE_NTIP_WAITTIME_SHIFT) )>
	endm

SERVICE_NT_WAIT_GET macro code
	exitm<((((code) AND UPPER_GET_HINT_MASK) SHR SERVICE_NTIP_WAITTIME_SHIFT) OR (((code) AND LOWER_GET_HINT_MASK) SHR SERVICE_IP_WAITTIME_SHIFT))>
	endm

endif
