ReactOS 0.4.15-dev-6052-g2626c72
precomp.h
Go to the documentation of this file.
1#ifndef __SERVMAN_PRECOMP_H
2#define __SERVMAN_PRECOMP_H
3
4#define WIN32_NO_STATUS
5#define _INC_WINDOWS
6#define COM_NO_WINDOWS_H
7
8#include <windef.h>
9#include <winbase.h>
10#include <winerror.h>
11#include <wingdi.h>
12#include <winsvc.h>
13#include <wincon.h>
14
15#include <shlobj.h>
16#include <commdlg.h>
17#include <strsafe.h>
18#include <process.h>
19
20#include "resource.h"
21
22#ifdef _MSC_VER
23#pragma warning(disable : 4100)
24#endif
25
26#define NO_ITEM_SELECTED -1
27#define MAX_KEY_LENGTH 256
28
29#define LVNAME 0
30#define LVDESC 1
31#define LVSTATUS 2
32#define LVSTARTUP 3
33#define LVLOGONAS 4
34
35#define IMAGE_UNKNOWN 0
36#define IMAGE_SERVICE 1
37#define IMAGE_DRIVER 2
38
39#define ACTION_START 1
40#define ACTION_STOP 2
41#define ACTION_PAUSE 3
42#define ACTION_RESUME 4
43#define ACTION_RESTART 5
44
45#define ORD_ASCENDING 1
46#define ORD_DESCENDING -1
47
48typedef struct _MAIN_WND_INFO
49{
57
61
62 INT SelectedItem;/* selection number in the list view */
65
69
71
73
74
79
80
81/* servman.c */
82extern HINSTANCE hInstance;
83extern HANDLE ProcessHeap;
84
85/* mainwnd.c */
86typedef struct _MENU_HINT
87{
91
97HWND CreateMainWindow(LPCTSTR lpCaption, int nCmdShow);
98
99/* listview.c */
100VOID SetListViewStyle(HWND hListView, DWORD View);
103
104/* start / stop / control */
105DWORD DoStartService(LPWSTR ServiceName, HANDLE hProgress, LPWSTR lpStartParams);
108
109/* progress.c */
110#define DEFAULT_STEP 0
112VOID IncrementProgressBar(HANDLE hProgress, UINT NewPos);
114
115/* query.c */
118BOOL SetServiceConfig(LPQUERY_SERVICE_CONFIG pServiceConfig, LPWSTR lpServiceName, LPWSTR lpPassword);
119LPWSTR GetServiceDescription(LPWSTR lpServiceName);
120BOOL SetServiceDescription(LPWSTR lpServiceName, LPWSTR lpDescription);
126
127/* propsheet.c */
128typedef struct _SERVICEPROPSHEET
129{
132
134
135typedef struct _DEPENDDATA
136{
142
144
145
146HTREEITEM AddItemToTreeView(HWND hTreeView, HTREEITEM hRoot, LPWSTR lpDisplayName, LPWSTR lpServiceName, ULONG serviceType, BOOL bHasChildren);
147
148/* stop_dependencies */
151BOOL
154LPWSTR DisplayName,
155LPWSTR ServiceList);
156
157/* tv1_dependencies */
158BOOL TV1_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName);
159VOID TV1_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName);
160
161/* tv2_dependencies */
162BOOL TV2_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName);
163VOID TV2_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName);
165LPENUM_SERVICE_STATUS TV2_GetDependants(LPWSTR lpServiceName, LPDWORD lpdwCount);
166
168
169/* propsheet window procs */
171 UINT uMsg,
173 LPARAM lParam);
175 UINT uMsg,
177 LPARAM lParam);
179 UINT uMsg,
181 LPARAM lParam);
183 UINT uMsg,
185 LPARAM lParam);
186
187/* export.c */
189
190/* misc.c */
193 IN UINT uID);
195 IN UINT uID,
196 OUT LPWSTR *lpTarget,
197 ...);
199 IN INT PartId,
201 IN UINT uID,
202 ...);
204 IN INT PartId,
206 IN UINT uID);
208 IN HWND hDlg,
209 IN UINT Res);
212HIMAGELIST InitImageList(UINT StartResource,
213 UINT EndResource,
214 UINT Width,
215 UINT Height,
216 ULONG type);
217VOID
220 HWND hwnd,
221 UINT uType,
222 UINT uCaptionId,
223 UINT uMessageId);
224
225#endif /* __SERVMAN_PRECOMP_H */
HINSTANCE hInstance
Definition: charmap.c:19
HINSTANCE hInst
Definition: dxdiag.c:13
INT AllocAndLoadString(OUT LPTSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:59
DWORD LoadAndFormatString(IN HINSTANCE hInstance, IN UINT uID, OUT LPTSTR *lpTarget,...)
Definition: misc.c:85
struct _DEPENDDATA DEPENDDATA
struct _DEPENDDATA * PDEPENDDATA
BOOL TV2_HasDependantServices(LPWSTR lpServiceName)
LPWSTR GetExecutablePath(LPWSTR lpServiceName)
LPQUERY_SERVICE_CONFIG GetServiceConfig(LPWSTR lpServiceName)
Definition: query.c:29
VOID SetListViewStyle(HWND hListView, DWORD View)
Definition: listview.c:34
VOID UninitMainWindowImpl(VOID)
Definition: mainwnd.c:992
INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: about.c:4
BOOL SetServiceConfig(LPQUERY_SERVICE_CONFIG pServiceConfig, LPWSTR lpServiceName, LPWSTR lpPassword)
Definition: query.c:82
ENUM_SERVICE_STATUS_PROCESS * GetSelectedService(PMAIN_WND_INFO Info)
Definition: query.c:13
INT GetTextFromEdit(OUT LPWSTR lpString, IN HWND hDlg, IN UINT Res)
Definition: misc.c:174
LPWSTR GetListOfServicesToStop(LPWSTR lpServiceName)
struct _MENU_HINT * PMENU_HINT
VOID OpenPropSheet(PMAIN_WND_INFO Info)
Definition: propsheet.c:30
struct _MAIN_WND_INFO MAIN_WND_INFO
HIMAGELIST InitImageList(UINT StartResource, UINT EndResource, UINT Width, UINT Height, ULONG type)
Definition: misc.c:219
BOOL TV1_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName)
BOOL RefreshServiceList(PMAIN_WND_INFO Info)
Definition: listview.c:247
VOID SetMenuAndButtonStates(PMAIN_WND_INFO Info)
Definition: mainwnd.c:152
HTREEITEM AddItemToTreeView(HWND hTreeView, HTREEITEM hRoot, LPWSTR lpDisplayName, LPWSTR lpServiceName, ULONG serviceType, BOOL bHasChildren)
VOID ExportFile(PMAIN_WND_INFO Info)
Definition: export.c:98
HANDLE ProcessHeap
Definition: servman.c:15
VOID TV2_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName)
struct _MAIN_WND_INFO * PMAIN_WND_INFO
INT_PTR CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam)
Definition: progress.c:281
BOOL SetServiceDescription(LPWSTR lpServiceName, LPWSTR lpDescription)
Definition: query.c:210
struct _SERVICEPROPSHEET SERVICEPROPSHEET
VOID ResourceMessageBox(HINSTANCE hInstance, HWND hwnd, UINT uType, UINT uCaptionId, UINT uMessageId)
Definition: misc.c:282
VOID FreeServiceList(PMAIN_WND_INFO Info)
Definition: query.c:257
INT_PTR CALLBACK DependenciesPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
DWORD DoStartService(LPWSTR ServiceName, HANDLE hProgress, LPWSTR lpStartParams)
Definition: start.c:18
VOID UpdateServiceCount(PMAIN_WND_INFO Info)
Definition: mainwnd.c:125
VOID GetError(VOID)
Definition: misc.c:192
BOOL RunActionWithProgress(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT Action, PVOID Param)
Definition: progress.c:372
DWORD DoControlService(LPWSTR ServiceName, HWND hProgress, DWORD Control)
Definition: control.c:18
INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
BOOL GetServiceList(PMAIN_WND_INFO Info)
Definition: query.c:279
struct _MENU_HINT MENU_HINT
BOOL CreateStopDependsDialog(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, LPWSTR ServiceList)
BOOL UpdateServiceStatus(ENUM_SERVICE_STATUS_PROCESS *pService)
Definition: query.c:373
BOOL InitMainWindowImpl(VOID)
Definition: mainwnd.c:966
DWORD DoStopService(LPWSTR ServiceName, HANDLE hProgress)
BOOL StatusBarLoadString(IN HWND hStatusBar, IN INT PartId, IN HINSTANCE hInstance, IN UINT uID)
Definition: misc.c:150
VOID IncrementProgressBar(HANDLE hProgress, UINT NewPos)
Definition: progress.c:338
INT_PTR CALLBACK LogonPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
BOOL StatusBarLoadAndFormatString(IN HWND hStatusBar, IN INT PartId, IN HINSTANCE hInstance, IN UINT uID,...)
Definition: misc.c:108
struct _SERVICEPROPSHEET * PSERVICEPROPSHEET
VOID CompleteProgressBar(HANDLE hProgress)
Definition: progress.c:311
VOID DisplayString(PWCHAR)
INT_PTR CALLBACK DeleteDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: delete.c:57
VOID ChangeListViewText(PMAIN_WND_INFO Info, ENUM_SERVICE_STATUS_PROCESS *pService, UINT Column)
Definition: listview.c:105
VOID TV1_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName)
LPWSTR GetServiceDescription(LPWSTR lpServiceName)
Definition: query.c:135
INT_PTR CALLBACK RecoveryPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
BOOL TV2_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName)
VOID ListViewSelectionChanged(PMAIN_WND_INFO Info, LPNMLISTVIEW pnmv)
Definition: listview.c:48
INT_PTR CALLBACK StopDependsDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
LPENUM_SERVICE_STATUS TV2_GetDependants(LPWSTR lpServiceName, LPDWORD lpdwCount)
BOOL CreateListView(PMAIN_WND_INFO Info)
Definition: listview.c:355
INT_PTR CALLBACK CreateDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: create.c:218
static WCHAR ServiceName[]
Definition: browser.c:19
HWND CreateMainWindow()
Definition: biditext.c:330
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define CALLBACK
Definition: compat.h:35
static const WCHAR Message[]
Definition: register.c:74
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
HWND hStatusBar
Definition: winproc.cpp:20
static HTREEITEM hRoot
Definition: treeview.c:381
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
unsigned int UINT
Definition: ndis.h:50
PSERVICEPROPSHEET pDlgInfo
Definition: precomp.h:137
HWND hDependsTreeView1
Definition: precomp.h:140
HIMAGELIST hDependsImageList
Definition: precomp.h:138
HWND hDependsTreeView2
Definition: precomp.h:141
HWND hDependsWnd
Definition: precomp.h:139
HWND hTool
Definition: precomp.h:53
PVOID pTag
Definition: precomp.h:70
INT SelectedItem
Definition: precomp.h:62
HMENU hShortcutMenu
Definition: precomp.h:55
HWND hStatus
Definition: precomp.h:52
HWND hHeader
Definition: precomp.h:54
HWND hMainWnd
Definition: precomp.h:50
BOOL bDlgOpen
Definition: precomp.h:66
HWND hListView
Definition: precomp.h:51
ENUM_SERVICE_STATUS_PROCESS * pAllServices
Definition: precomp.h:58
ENUM_SERVICE_STATUS_PROCESS * pCurrentService
Definition: precomp.h:59
DWORD NumServices
Definition: precomp.h:60
BOOL bIsUserAnAdmin
Definition: precomp.h:68
INT SortDirection
Definition: precomp.h:64
BOOL bInMenuLoop
Definition: precomp.h:67
INT SortSelection
Definition: precomp.h:63
int nCmdShow
Definition: precomp.h:56
UINT HintId
Definition: precomp.h:89
WORD CmdId
Definition: precomp.h:88
ENUM_SERVICE_STATUS_PROCESS * pService
Definition: precomp.h:131
PMAIN_WND_INFO Info
Definition: precomp.h:130
Definition: tftpd.h:60
int32_t INT_PTR
Definition: typedefs.h:64
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:126
_In_ HFONT _Out_ PUINT Height
Definition: font.h:125
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:510
_In_ WDF_WMI_PROVIDER_CONTROL Control
Definition: wdfwmi.h:166
_In_ LPCSTR _Out_writes_to_opt_ cchDisplayName LPSTR lpDisplayName
Definition: winbase.h:2777
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const CHAR * LPCTSTR
Definition: xmlstorage.h:193