怎么样通过MASM32编程获取系统服务列表及其状态?

怎么样通过MASM32编程获取系统服务列表及其状态?

;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
;FileName:List_Svc2.asm

;Function:Demothewaytolistsystem services and their status
;Author:PurpleEndurer
;DevEmv:WinXPSP2,MASM32
;
;LOG
;---------------------------------------------------
;2006-11-17Created!
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

.386
.modelflat,stdcall
optioncasemap:none
include/masm32/include/windows.inc

include/masm32/include/user32.inc
includelib/masm32/lib/user32.lib

include/masm32/include/kernel32.inc
includelib/masm32/lib/kernel32.lib

include/masm32/include/advapi32.inc
includelib/masm32/lib/advapi32.lib


WinMainPROTO:DWORD,:DWORD,:DWORD,:DWORD
ResizeConctrolPROTO
ShowServiceInfoPROTO:dword,:dword,:dword
ShowSvcStatusInfoPROTO:dword
ShowSvcDataPROTO:dword,:dword,:dword

;.const
IDC_BtnEnumequ103
IDC_EdtFileSpecequ105
IDC_EdtVerInfoequ107

c_GrpSvcTypeTopequ5
c_GrpSvcTypeLeftequ2

c_ChkBtnSvcWin32Topequc_GrpSvcTypeTop+15
c_ChkBtnSvcWin32Leftequc_GrpSvcTypeLeft+5
c_ChkBtnSvcWin32Widthequ150
c_ChkBtnSvcWin32Heightequ15

c_ChkBtnSvcDrvTopequc_ChkBtnSvcWin32Top+c_ChkBtnSvcWin32Height+5
c_ChkBtnSvcDrvLeftequc_ChkBtnSvcWin32Left
c_ChkBtnSvcDrvWidthequc_ChkBtnSvcWin32Width
c_ChkBtnSvcDrvHeightequc_ChkBtnSvcWin32Height

c_GrpSvcTypeWidthequc_ChkBtnSvcWin32Width+10
c_GrpSvcTypeHeightequc_ChkBtnSvcDrvTop+c_ChkBtnSvcDrvHeight+5


c_GrpSvcStateTopequc_GrpSvcTypeTop
c_GrpSvcStateLeftequc_GrpSvcTypeLeft+c_GrpSvcTypeWidth+10

c_ChkBtnSvcActTopequc_GrpSvcStateTop+15
c_ChkBtnSvcActLeftequc_GrpSvcStateLeft+5
c_ChkBtnSvcActWidthequ150
c_ChkBtnSvcActHeightequ15

c_ChkBtnSvcInActTopequc_ChkBtnSvcActTop+c_ChkBtnSvcActHeight+5
c_ChkBtnSvcInActLeftequc_ChkBtnSvcActLeft
c_ChkBtnSvcInActWidthequc_ChkBtnSvcActWidth
c_ChkBtnSvcInActHeightequc_ChkBtnSvcActHeight

c_GrpSvcStateWidthequc_ChkBtnSvcActWidth+10
c_GrpSvcStateHeightequc_ChkBtnSvcInActTop+c_ChkBtnSvcInActHeight+5

c_BtnShowTopequc_GrpSvcTypeTop
c_BtnShowLeftequ(c_GrpSvcStateLeft+c_GrpSvcStateWidth+10)
c_BtnShowWidthequ70
c_BtnShowHeightequ25

c_EdtSvrInfoLeftequ2
c_EdtSvrInfoTopequc_GrpSvcTypeTop+c_GrpSvcTypeHeight+5
c_EdtSvrInfoHeightequ165

c_WinWidthequc_BtnShowLeft+c_BtnShowWidth+10;c_EdtSvrInfoLeft+c_EdtSvrInfoWidth+2
c_WinHeightequc_EdtSvrInfoTop+c_EdtSvrInfoHeight+45

c_EdtSvrInfoWidthequc_WinWidth-8-c_EdtSvrInfoLeft

m_CatStrMACROszStr:REQ
invokeSendMessage,g_hEditSvrInfo,EM_REPLACESEL,FALSE,szStr
ENDM

m_GoNextLineMACRO
invokeSendMessage,g_hEditSvrInfo,EM_REPLACESEL,FALSE,ADDRg_szCR
ENDM

m_MsgBoxMACROlpszMsg:REQ,dwIcon:REQ
invokeMessageBox,g_hWndMain,lpszMsg,OFFSETg_szAppName_cn,dwIcon
ENDM


.data
g_szClsNamedb"ListSvrCls",0
g_szAppName_cndb"系统服务列表",0
g_szEditClsdb"EDIT",0
g_szBtnClsdb"button",0
g_szBtnEnumSvc_cndb"&E枚举",0
g_szSERVICE_WIN32db"SERVICE_WIN32",0
g_szSERVICE_DRIVERdb"SERVICE_DRIVER",0
g_szSERVICE_ACTIVEdb"SERVICE_ACTIVE",0
g_szSERVICE_INACTIVEdb"SERVICE_INACTIVE",0
g_szChkSvrTypeFirst_cndb"请先选择要枚举的"
g_szServiceType_cndb"服务类型:",0
g_szChkSvrStateFirst_cndb"请先选择要枚举的"
g_szServiceState_cndb"服务状态:",0


.data?
g_hInstanceHINSTANCE?
g_hWndMainHANDLE?
g_hEditFileSpecHANDLE?
g_hBtnShowHANDLE?
g_hEditSvrInfoHANDLE?
g_szFileSpecdb256dup(?)
g_hGrpServiceTypeHANDLE?
g_hChkBtnSvcWin32HANDLE?
g_hChkBtnSvcDrvHANDLE?
g_hGrpServiceStateHANDLE?
g_hChkBtnSvcActHANDLE?
g_hChkBtnSvcInActHANDLE?
g_dwServiceTypedword?
g_dwServiceStatedword?


.code
start:
invokeGetModuleHandle,NULL
movg_hInstance,eax
invokeWinMain,g_hInstance,NULL,NULL,SW_SHOWDEFAULT
invokeExitProcess,eax


WinMainprochInst:DWORD,hPrevInst:DWORD,CmdLine:DWORD,CmdShow:DWORD
LOCALwc:WNDCLASSEX
LOCALmsg:MSG
LOCALhwnd:HWND

movwc.cbSize,SIZEOFWNDCLASSEX
movwc.style,CS_HREDRAWorCS_VREDRAW
movwc.lpfnWndProc,OFFSETWndProc
movwc.cbClsExtra,NULL
movwc.cbWndExtra,NULL
moveax,g_hInstance
movwc.hInstance,eax
movwc.hbrBackground,COLOR_APPWORKSPACE
movwc.lpszMenuName,NULL
movwc.lpszClassName,OFFSETg_szClsName
invokeLoadIcon,NULL,IDI_APPLICATION
movwc.hIcon,eax
movwc.hIconSm,eax
invokeLoadCursor,NULL,IDC_ARROW
movwc.hCursor,eax
invokeRegisterClassEx,addrwc
invokeCreateWindowEx,WS_EX_TOPMOST,ADDRg_szClsName,/
ADDRg_szAppName_cn,WS_OVERLAPPEDWINDOW+WS_VISIBLE,/
CW_USEDEFAULT,CW_USEDEFAULT,c_WinWidth,c_WinHeight,/
NULL,NULL,hInst,NULL
movhwnd,eax
.whileTRUE
invokeGetMessage,ADDRmsg,NULL,0,0
.BREAK.IF(!eax)

;---processkeystrokesdirectlyinthemessageloop
.ifmsg.message==WM_SYSKEYUP
.ifmsg.wParam==VK_E;Alt+E
invokePostMessage,hwnd,WM_COMMAND,IDC_BtnEnum,BM_CLICK
.endif
.endif
;------------------------------------------------
invokeTranslateMessage,ADDRmsg
invokeDispatchMessage,ADDRmsg
.endw
moveax,msg.wParam
ret
WinMainendp


WndProcprochWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
LOCALrect:RECT
LOCALhdc:DWORD

.ifuMsg==WM_CREATE
moveax,hWnd
movg_hWndMain,eax

;---Createenumbutton
invokeCreateWindowEx,NULL,addrg_szBtnCls,addrg_szBtnEnumSvc_cn,/
WS_CHILD+WS_VISIBLE,c_BtnShowLeft,c_BtnShowTop,c_BtnShowWidth,c_BtnShowHeight,/
hWnd,IDC_BtnEnum,g_hInstance,NULL
movg_hBtnShow,eax

;---Creategroup
invokeCreateWindowEx,NULL,addrg_szBtnCls,offsetg_szServiceType_cn,/
WS_CHILD+WS_VISIBLE+BS_GROUPBOX,c_GrpSvcTypeLeft,c_GrpSvcTypeTop,/
c_GrpSvcTypeWidth,c_GrpSvcTypeHeight,/
hWnd,NULL,g_hInstance,NULL
movg_hGrpServiceType,eax

;---Createautocheckbutton
invokeCreateWindowEx,NULL,addrg_szBtnCls,offsetg_szSERVICE_WIN32,/
WS_CHILD+WS_VISIBLE+BS_AUTOCHECKBOX,c_ChkBtnSvcWin32Left,c_ChkBtnSvcWin32Top,/
c_ChkBtnSvcWin32Width,c_ChkBtnSvcWin32Height,/
hWnd,NULL,g_hInstance,NULL
movg_hChkBtnSvcWin32,eax

;---Createautocheckbutton
invokeCreateWindowEx,NULL,addrg_szBtnCls,offsetg_szSERVICE_DRIVER,/
WS_CHILD+WS_VISIBLE+BS_AUTOCHECKBOX,c_ChkBtnSvcDrvLeft,c_ChkBtnSvcDrvTop,/
c_ChkBtnSvcDrvWidth,c_ChkBtnSvcDrvHeight,/
hWnd,NULL,g_hInstance,NULL
movg_hChkBtnSvcDrv,eax

;---Creategroup
invokeCreateWindowEx,NULL,addrg_szBtnCls,offsetg_szServiceState_cn,/
WS_CHILD+WS_VISIBLE+BS_GROUPBOX,c_GrpSvcStateLeft,c_GrpSvcStateTop,/
c_GrpSvcStateWidth,c_GrpSvcStateHeight,/
hWnd,NULL,g_hInstance,NULL
movg_hGrpServiceState,eax

;---Createautocheckbutton
invokeCreateWindowEx,NULL,addrg_szBtnCls,offsetg_szSERVICE_ACTIVE,/
WS_CHILD+WS_VISIBLE+BS_AUTOCHECKBOX,c_ChkBtnSvcActLeft,c_ChkBtnSvcActTop,/
c_ChkBtnSvcActWidth,c_ChkBtnSvcActHeight,/
hWnd,NULL,g_hInstance,NULL
movg_hChkBtnSvcAct,eax

;---Createautocheckbutton
invokeCreateWindowEx,NULL,addrg_szBtnCls,offsetg_szSERVICE_INACTIVE,/
WS_CHILD+WS_VISIBLE+BS_AUTOCHECKBOX,c_ChkBtnSvcInActLeft,c_ChkBtnSvcInActTop,/
c_ChkBtnSvcInActWidth,c_ChkBtnSvcInActHeight,/
hWnd,NULL,g_hInstance,NULL
movg_hChkBtnSvcInAct,eax

;---Createservicesinfoeditbox
invokeCreateWindowEx,NULL,addrg_szEditCls,NULL,/
WS_CHILD+WS_VISIBLE+ES_MULTILINE+WS_HSCROLL+WS_VSCROLL,/
c_EdtSvrInfoLeft,c_EdtSvrInfoTop,c_EdtSvrInfoWidth,c_EdtSvrInfoHeight,/
hWnd,IDC_EdtVerInfo,g_hInstance,NULL
movg_hEditSvrInfo,eax

.elseifuMsg==WM_COMMAND
.iflParam!=0
moveax,wParam
.IFax==IDC_BtnEnum
shreax,16
.ifax==BN_CLICKED
xoreax,eax
movg_dwServiceType,eax
invokeSendMessage,g_hChkBtnSvcWin32,BM_GETCHECK,eax,eax
.ifeax==BST_CHECKED
org_dwServiceType,SERVICE_WIN32
.endif
xoreax,eax
invokeSendMessage,g_hChkBtnSvcDrv,BM_GETCHECK,eax,eax
.ifeax==BST_CHECKED
org_dwServiceType,SERVICE_DRIVER
.endif
cmpg_dwServiceType,0
jne@F
m_MsgBoxOFFSETg_szChkSvrTypeFirst_cn,NULL
xoreax,eax
jz@BtnClkEnd
@@:
xoreax,eax
movg_dwServiceState,eax
invokeSendMessage,g_hChkBtnSvcAct,BM_GETCHECK,eax,eax
.ifeax==BST_CHECKED
org_dwServiceState,SERVICE_ACTIVE
.endif
xoreax,eax
invokeSendMessage,g_hChkBtnSvcInAct,BM_GETCHECK,eax,eax
.ifeax==BST_CHECKED
org_dwServiceState,SERVICE_INACTIVE
.endif
cmpg_dwServiceState,0
jne@F
m_MsgBoxOFFSETg_szChkSvrStateFirst_cn,NULL
xoreax,eax
jz@BtnClkEnd
@@:
invokeShowServiceInfo,SC_MANAGER_ENUMERATE_SERVICE,g_dwServiceType,g_dwServiceState
@BtnClkEnd:
.endif
.ENDIF
.endif
.elseifuMsg==WM_DESTROY
invokePostQuitMessage,NULL
.elseifuMsg==WM_SIZE
invokeResizeConctrol
xoreax,eax
jz@F
.else
@@:
invokeDefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
xoreax,eax
ret
WndProcendp

ResizeConctrolPROC
LOCALst_Rect:RECT

invokeGetClientRect,g_hWndMain,ADDRst_Rect

;---ResizetheEnumbutton
moveax,st_Rect.right
subeax,5+c_BtnShowWidth
pusheax
invokeMoveWindow,g_hBtnShow,eax,c_BtnShowTop,c_BtnShowWidth,c_BtnShowHeight,TRUE

;---Resizetheserviceeditbox
moveax,st_Rect.right
subeax,5

movedi,st_Rect.bottom
subedi,70

invokeMoveWindow,g_hEditSvrInfo,c_EdtSvrInfoLeft,c_EdtSvrInfoTop,eax,edi,TRUE

ret
ResizeConctrolENDP


ShowServiceInfoPROCdwDesiredAccess:dword,dwServiceType:dword,dwServiceState:dword
LOCALhSCM,hResume,hMem:HANDLE
LOCALdwBytesNeeded,dwServiceNum:dword
LOCALlpstCurSvr:dword
LOCALBuf1[22]:byte

xoreax,eax
jz@F
g_szERROR_ACCESS_DENIEDdb"Therequestedaccesswasdenied.",0
g_szERROR_DATABASE_DOES_NOT_EXISTdb"Thespecifieddatabasedoesnotexist.",0
g_szERROR_INVALID_PARAMETERdb"Aparameterthatwasspecifiedisinvalid.",0
g_szERROR_INVALID_HANDLEdb"Thespecifiedhandleisinvalid.",0
g_szERROR_MORE_DATAdb"TherearemoreserviceentriesthanwouldfitintothelpServicesbuffer.",0
g_szFailGlobalAllocdb"FailtoGlobalAlloc",0
g_szOpenSCManagerdb"CallOpenSCManager",0
g_szEnumServicesStatusdb"CallEnumServicesStatus",0
g_szBlkOKdb"OK!"
g_szCRdb0dh,0ah,0
g_sz3hyphensdb"---",0
g_szFmtTotaldb"Total:%d",0
@@:
;SC_HANDLEOpenSCManager(
;LPCTSTRlpMachineName,//pointertomachinenamestring
;LPCTSTRlpDatabaseName,//pointertodatabasenamestring
;DWORDdwDesiredAccess//typeofaccess
;);
m_CatStrOFFSETg_szOpenSCManager
invokeOpenSCManager,NULL,NULL,dwDesiredAccess
cmpeax,NULL
jne@F
invokeGetLastError
.ifeax==ERROR_ACCESS_DENIED
moveax,OfFSETg_szERROR_ACCESS_DENIED
.elseifeax==ERROR_DATABASE_DOES_NOT_EXIST
moveax,OFFSETg_szERROR_DATABASE_DOES_NOT_EXIST
.elseifeax==ERROR_INVALID_PARAMETER
moveax,OFFSETg_szERROR_INVALID_PARAMETER
.else
moveax,NULL
.endif
m_CatStreax
ret
@@:
movhSCM,eax
m_CatStrOFFSETg_szBlkOK
m_CatStrOFFSETg_szEnumServicesStatus

;BOOLEnumServicesStatus(
;SC_HANDLEhSCManager,//handletoservicecontrolmanagerdatabase
;DWORDdwServiceType,//typeofservicestoenumerate
;DWORDdwServiceState,//stateofservicestoenumerate
;LPENUM_SERVICE_STATUSlpServices,//pointertoservicestatusbuffer
;DWORDcbBufSize,//sizeofservicestatusbuffer
;LPDWORDpcbBytesNeeded,//pointertovariableforbytesneeded
;LPDWORDlpServicesReturned,//pointertovariablefornumberreturned
;LPDWORDlpResumeHandle//pointertovariablefornextentry
;);
movhResume,0
invokeEnumServicesStatus,hSCM,dwServiceType,dwServiceState,/
NULL,NULL,ADDRdwBytesNeeded,/
ADDRdwServiceNum,ADDRhResume
invokeGetLastError
cmpeax,ERROR_MORE_DATA
je@F
@EnumServicesStatusErr:
.ifeax==ERROR_ACCESS_DENIED
moveax,OfFSETg_szERROR_ACCESS_DENIED
.elseifeax==ERROR_INVALID_HANDLE
moveax,OFFSETg_szERROR_INVALID_HANDLE
.elseifeax==ERROR_INVALID_PARAMETER
moveax,OFFSETg_szERROR_INVALID_PARAMETER
.elseifeax==ERROR_MORE_DATA
moveax,OFFSETg_szERROR_MORE_DATA
.else
moveax,NULL
.endif
m_CatStreax
invokeCloseServiceHandle,hSCM
ret
@@:
m_CatStrOFFSETg_szBlkOK
m_CatStrOFFSETg_szEnumServicesStatus
invokeGlobalAlloc,GMEM_ZEROINIT,dwBytesNeeded
cmpeax,NULL
jnz@F
m_CatStrOFFSETg_szFailGlobalAlloc
invokeCloseServiceHandle,hSCM
ret
@@:
movhMem,eax
m_CatStrOFFSETg_szBlkOK
movhResume,0
invokeEnumServicesStatus,hSCM,dwServiceType,dwServiceState,/
hMem,dwBytesNeeded,ADDRdwBytesNeeded,/
ADDRdwServiceNum,ADDRhResume
oreax,eax
jnz@F
invokeGetLastError
pusheax
invokeGlobalFree,hMem
popeax
jmp@EnumServicesStatusErr
@@:
m_CatStrOFFSETg_sz3hyphens
m_CatStrOFFSETg_szAppName_cn
m_CatStrOFFSETg_sz3hyphens
invokewsprintf,ADDRBuf1,OFFSETg_szFmtTotal,dwServiceNum
m_CatStrADDRBuf1
m_GoNextLine
;pushedx
movedx,hMem
xoreax,eax
.whileeax<dwServiceNum
pusheax
movlpstCurSvr,edx

m_CatStr(ENUM_SERVICE_STATUSptr[edx]).lpServiceName
m_CatStrOFFSETg_sz3hyphens
movedx,lpstCurSvr
m_CatStr(ENUM_SERVICE_STATUSptr[edx]).lpDisplayName
m_GoNextLine
movedx,lpstCurSvr
leaeax,(ENUM_SERVICE_STATUSptr[edx]).ServiceStatus
invokeShowSvcStatusInfo,eax
m_GoNextLine
movedx,lpstCurSvr
addedx,SIZEOFENUM_SERVICE_STATUS
popeax
inceax
.endw
;popedx
invokeGlobalFree,hMem
invokeCloseServiceHandle,hSCM
ret
ShowServiceInfoENDP


ShowSvcStatusInfoPROClpstSrvStatus:dword
xoreax,eax
jz@F
;---type
g_szSERVICE_WIN32_OWN_PROCESSdb"SERVICE_WIN32_OWN_PROCESS",0
g_szSERVICE_WIN32_SHARE_PROCESSdb"SERVICE_WIN32_SHARE_PROCESS",0
g_szSERVICE_KERNEL_DRIVERdb"SERVICE_KERNEL_DRIVER",0
g_szSERVICE_FILE_SYSTEM_DRIVERdb"SERVICE_FILE_SYSTEM_DRIVER",0
g_szSERVICE_INTERACTIVE_PROCESSdb"SERVICE_INTERACTIVE_PROCESS",0
g_szSvcTypeArrdwordSERVICE_WIN32_OWN_PROCESS,OFFSETg_szSERVICE_WIN32_OWN_PROCESS
dwordSERVICE_WIN32_SHARE_PROCESS,OFFSETg_szSERVICE_WIN32_SHARE_PROCESS
dwordSERVICE_KERNEL_DRIVER,OFFSETg_szSERVICE_KERNEL_DRIVER
dwordSERVICE_FILE_SYSTEM_DRIVER,OFFSETg_szSERVICE_FILE_SYSTEM_DRIVER
dwordSERVICE_INTERACTIVE_PROCESS,OFFSETg_szSERVICE_INTERACTIVE_PROCESS
c_SvcTypeArrLenequ($-(offsetg_szSvcTypeArr))/8
;---status
g_szSERVICE_STOPPEDdb"SERVICE_STOPPED",0
g_szSERVICE_START_PENDINGdb"SERVICE_START_PENDING",0
g_szSERVICE_STOP_PENDINGdb"SERVICE_STOP_PENDING",0
g_szSERVICE_RUNNINGdb"SERVICE_RUNNING",0
g_szSERVICE_CONTINUE_PENDINGdb"SERVICE_CONTINUE_PENDING",0
g_szSERVICE_PAUSE_PENDINGdb"SERVICE_PAUSE_PENDING",0
g_szSERVICE_PAUSEDdb"SERVICE_PAUSED",0

g_szSvcStatusArrdwordSERVICE_STOPPED,OFFSETg_szSERVICE_STOPPED
dwordSERVICE_START_PENDING,OFFSETg_szSERVICE_START_PENDING
dwordSERVICE_STOP_PENDING,OFFSETg_szSERVICE_STOP_PENDING
dwordSERVICE_RUNNING,OFFSETg_szSERVICE_RUNNING
dwordSERVICE_CONTINUE_PENDING,OFFSETg_szSERVICE_CONTINUE_PENDING
dwordSERVICE_PAUSE_PENDING,OFFSETg_szSERVICE_PAUSE_PENDING
dwordSERVICE_PAUSED,OFFSETg_szSERVICE_PAUSED
c_SvcStatusArrLenequ($-(offsetg_szSvcStatusArr))/8

;---
g_szControlsAccepted_cndb"可受控制:",0
g_szSERVICE_ACCEPT_STOPdb"SERVICE_ACCEPT_STOP",0
g_szSERVICE_ACCEPT_PAUSE_CONTINUEdb"SERVICE_ACCEPT_PAUSE_CONTINUE",0
g_szSERVICE_ACCEPT_SHUTDOWNdb"SERVICE_ACCEPT_SHUTDOWN",0
g_szSvcAccCtlArrdwordSERVICE_ACCEPT_STOP,OFFSETg_szSERVICE_ACCEPT_STOP
dwordSERVICE_ACCEPT_PAUSE_CONTINUE,OFFSETg_szSERVICE_ACCEPT_PAUSE_CONTINUE
dwordSERVICE_ACCEPT_SHUTDOWN,OFFSETg_szSERVICE_ACCEPT_SHUTDOWN
c_SvcAccCtlArrLenequ($-(offsetg_szSvcAccCtlArr))/8
@@:

;typedefstruct_SERVICE_STATUS{//ss
;DWORDdwServiceType;
;DWORDdwCurrentState;
;DWORDdwControlsAccepted;
;DWORDdwWin32ExitCode;
;DWORDdwServiceSpecificExitCode;
;DWORDdwCheckPoint;
;DWORDdwWaitHint;
;}SERVICE_STATUS,*LPSERVICE_STATUS;
;---ServiceType
m_CatStrOFFSETg_szServiceType_cn
moveax,lpstSrvStatus
moveax,(SERVICE_STATUSptr[eax]).dwServiceType
invokeShowSvcData,eax,OFFSETg_szSvcTypeArr,c_SvcTypeArrLen
m_GoNextLine

;---ServiceState
m_CatStrOFFSETg_szServiceState_cn
moveax,lpstSrvStatus
moveax,(SERVICE_STATUSptr[eax]).dwCurrentState
invokeShowSvcData,eax,OFFSETg_szSvcStatusArr,c_SvcStatusArrLen
m_GoNextLine

;---ControlsAccepted
m_CatStrOFFSETg_szControlsAccepted_cn
moveax,lpstSrvStatus
moveax,(SERVICE_STATUSptr[eax]).dwControlsAccepted
invokeShowSvcData,eax,OFFSETg_szSvcAccCtlArr,c_SvcAccCtlArrLen
m_GoNextLine

ret
ShowSvcStatusInfoENDP


ShowSvcDataPROCdwSvcData:DWORD,lpSvcDataArr:DWORD,dwDataArrLen:DWORD
LOCALlpPos:dword
LOCALdwIndex:dword

moveax,lpSvcDataArr
movdwIndex,0
@ShowSvcDataLoop1:
movedx,dwIndex
cmpedx,dwDataArrLen
je@ShowSvcDataRet
movlpPos,eax
moveax,[eax]
cmpdwSvcData,eax
jne@F