ReactOS  0.4.12-dev-51-ge94618b
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 <wingdi.h>
11 #include <winsvc.h>
12 #include <wincon.h>
13 #include <shlobj.h>
14 #include <commdlg.h>
15 #include <strsafe.h>
16 #include <process.h>
17 
18 #include "resource.h"
19 
20 #ifdef _MSC_VER
21 #pragma warning(disable : 4100)
22 #endif
23 
24 #define NO_ITEM_SELECTED -1
25 #define MAX_KEY_LENGTH 256
26 
27 #define LVNAME 0
28 #define LVDESC 1
29 #define LVSTATUS 2
30 #define LVSTARTUP 3
31 #define LVLOGONAS 4
32 
33 #define IMAGE_UNKNOWN 0
34 #define IMAGE_SERVICE 1
35 #define IMAGE_DRIVER 2
36 
37 #define ACTION_START 1
38 #define ACTION_STOP 2
39 #define ACTION_PAUSE 3
40 #define ACTION_RESUME 4
41 #define ACTION_RESTART 5
42 
43 #define ORD_ASCENDING 1
44 #define ORD_DESCENDING -1
45 
46 typedef struct _MAIN_WND_INFO
47 {
54  int nCmdShow;
55 
59 
60  INT SelectedItem;/* selection number in the list view */
63 
67 
69 
71 
72 
77 
78 
79 /* servman.c */
80 extern HINSTANCE hInstance;
81 extern HANDLE ProcessHeap;
82 
83 /* mainwnd.c */
84 typedef struct _MENU_HINT
85 {
89 
90 VOID SetMenuAndButtonStates(PMAIN_WND_INFO Info);
91 VOID UpdateServiceCount(PMAIN_WND_INFO Info);
92 VOID ChangeListViewText(PMAIN_WND_INFO Info, ENUM_SERVICE_STATUS_PROCESS* pService, UINT Column);
95 HWND CreateMainWindow(LPCTSTR lpCaption, int nCmdShow);
96 
97 /* listview.c */
99 VOID ListViewSelectionChanged(PMAIN_WND_INFO Info, LPNMLISTVIEW pnmv);
100 BOOL CreateListView(PMAIN_WND_INFO Info);
101 
102 /* start / stop / control */
103 BOOL DoStartService(LPWSTR ServiceName, HANDLE hProgress, LPWSTR lpStartParams);
106 
107 /* progress.c */
108 #define DEFAULT_STEP 0
110 VOID IncrementProgressBar(HANDLE hProgress, UINT NewPos);
111 VOID CompleteProgressBar(HANDLE hProgress);
112 
113 /* query.c */
116 BOOL SetServiceConfig(LPQUERY_SERVICE_CONFIG pServiceConfig, LPWSTR lpServiceName, LPWSTR lpPassword);
117 LPWSTR GetServiceDescription(LPWSTR lpServiceName);
118 BOOL SetServiceDescription(LPWSTR lpServiceName, LPWSTR lpDescription);
119 LPWSTR GetExecutablePath(LPWSTR lpServiceName);
120 VOID FreeServiceList(PMAIN_WND_INFO Info);
121 BOOL RefreshServiceList(PMAIN_WND_INFO Info);
123 BOOL GetServiceList(PMAIN_WND_INFO Info);
124 
125 
126 /* propsheet.c */
127 typedef struct _SERVICEPROPSHEET
128 {
129  PMAIN_WND_INFO Info;
131 
133 
134 typedef struct _DEPENDDATA
135 {
136  PSERVICEPROPSHEET pDlgInfo;
141 
143 
144 
145 HTREEITEM AddItemToTreeView(HWND hTreeView, HTREEITEM hRoot, LPWSTR lpDisplayName, LPWSTR lpServiceName, ULONG serviceType, BOOL bHasChildren);
146 
147 /* stop_dependencies */
149 LPWSTR GetListOfServicesToStop(LPWSTR lpServiceName);
150 BOOL
153 LPWSTR DisplayName,
154 LPWSTR ServiceList);
155 
156 /* tv1_dependencies */
157 BOOL TV1_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName);
158 VOID TV1_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName);
159 
160 /* tv2_dependencies */
161 BOOL TV2_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName);
162 VOID TV2_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName);
163 BOOL TV2_HasDependantServices(LPWSTR lpServiceName);
164 LPENUM_SERVICE_STATUS TV2_GetDependants(LPWSTR lpServiceName, LPDWORD lpdwCount);
165 
166 VOID OpenPropSheet(PMAIN_WND_INFO Info);
167 
168 /* propsheet window procs */
170  UINT uMsg,
171  WPARAM wParam,
172  LPARAM lParam);
174  UINT uMsg,
175  WPARAM wParam,
176  LPARAM lParam);
178  UINT uMsg,
179  WPARAM wParam,
180  LPARAM lParam);
182  UINT uMsg,
183  WPARAM wParam,
184  LPARAM lParam);
185 
186 /* export.c */
187 VOID ExportFile(PMAIN_WND_INFO Info);
188 
189 /* misc.c */
190 INT AllocAndLoadString(OUT LPWSTR *lpTarget,
192  IN UINT uID);
194  IN UINT uID,
195  OUT LPWSTR *lpTarget,
196  ...);
198  IN INT PartId,
199  IN HINSTANCE hInstance,
200  IN UINT uID,
201  ...);
203  IN INT PartId,
204  IN HINSTANCE hInstance,
205  IN UINT uID);
206 INT GetTextFromEdit(OUT LPWSTR lpString,
207  IN HWND hDlg,
208  IN UINT Res);
211 HIMAGELIST InitImageList(UINT StartResource,
212  UINT EndResource,
213  UINT Width,
214  UINT Height,
215  ULONG type);
216 VOID
218  HINSTANCE hInstance,
219  HWND hwnd,
220  UINT uType,
221  UINT uCaptionId,
222  UINT uMessageId);
223 
224 #endif /* __SERVMAN_PRECOMP_H */
INT_PTR CALLBACK StopDependsDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
HINSTANCE hInstance
Definition: charmap.c:20
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL CreateStopDependsDialog(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, LPWSTR ServiceList)
#define IN
Definition: typedefs.h:38
Definition: tftpd.h:59
VOID OpenPropSheet(PMAIN_WND_INFO Info)
Definition: propsheet.c:30
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
INT_PTR CALLBACK CreateDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: create.c:218
LPWSTR GetExecutablePath(LPWSTR lpServiceName)
UINT HintId
Definition: precomp.h:87
LPWSTR GetServiceDescription(LPWSTR lpServiceName)
Definition: query.c:135
BOOL TV2_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName)
BOOL DoStartService(LPWSTR ServiceName, HANDLE hProgress, LPWSTR lpStartParams)
Definition: start.c:15
BOOL RunActionWithProgress(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT Action, PVOID Param)
Definition: progress.c:322
HWND CreateMainWindow(LPCTSTR lpCaption, int nCmdShow)
Definition: mainwnd.c:920
#define CALLBACK
Definition: compat.h:27
ENUM_SERVICE_STATUS_PROCESS * GetSelectedService(PMAIN_WND_INFO Info)
Definition: query.c:13
BOOL DoControlService(LPWSTR ServiceName, HWND hProgress, DWORD Control)
Definition: control.c:15
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
BOOL SetServiceDescription(LPWSTR lpServiceName, LPWSTR lpDescription)
Definition: query.c:210
INT GetTextFromEdit(OUT LPWSTR lpString, IN HWND hDlg, IN UINT Res)
Definition: misc.c:174
HINSTANCE hInst
Definition: dxdiag.c:13
uint16_t * PWCHAR
Definition: typedefs.h:54
HIMAGELIST hDependsImageList
Definition: precomp.h:137
VOID GetError(VOID)
Definition: misc.c:192
VOID ExportFile(PMAIN_WND_INFO Info)
Definition: export.c:98
int32_t INT_PTR
Definition: typedefs.h:62
int32_t INT
Definition: typedefs.h:56
HWND hStatus
Definition: precomp.h:50
WPARAM wParam
Definition: combotst.c:138
struct TraceInfo Info
INT SelectedItem
Definition: precomp.h:60
INT SortSelection
Definition: precomp.h:61
BOOL DoStopService(LPWSTR ServiceName, HANDLE hProgress)
UINT_PTR WPARAM
Definition: windef.h:207
DWORD NumServices
Definition: precomp.h:58
BOOL CreateListView(PMAIN_WND_INFO Info)
Definition: listview.c:355
VOID ChangeListViewText(PMAIN_WND_INFO Info, ENUM_SERVICE_STATUS_PROCESS *pService, UINT Column)
Definition: listview.c:105
BOOL bInMenuLoop
Definition: precomp.h:65
INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
LONG_PTR LPARAM
Definition: windef.h:208
static HTREEITEM hRoot
Definition: treeview.c:381
INT_PTR CALLBACK DeleteDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: delete.c:57
PSERVICEPROPSHEET pDlgInfo
Definition: precomp.h:136
INT AllocAndLoadString(OUT LPWSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:50
WORD CmdId
Definition: precomp.h:86
VOID TV1_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName)
HWND hDependsTreeView2
Definition: precomp.h:140
unsigned int BOOL
Definition: ntddk_ex.h:94
int nCmdShow
Definition: precomp.h:54
LPENUM_SERVICE_STATUS TV2_GetDependants(LPWSTR lpServiceName, LPDWORD lpdwCount)
INT SortDirection
Definition: precomp.h:62
ENUM_SERVICE_STATUS_PROCESS * pAllServices
Definition: precomp.h:56
LPTSTR ServiceName
Definition: ServiceMain.c:15
BOOL TV2_HasDependantServices(LPWSTR lpServiceName)
BOOL GetServiceList(PMAIN_WND_INFO Info)
Definition: query.c:279
VOID DisplayString(PWCHAR)
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG _In_ ULONG Action
Definition: fsrtlfuncs.h:738
struct _DEPENDDATA DEPENDDATA
unsigned int UINT
Definition: ndis.h:50
struct _MAIN_WND_INFO * PMAIN_WND_INFO
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND hStatusBar
Definition: main.cpp:35
PVOID pTag
Definition: precomp.h:68
BOOL StatusBarLoadString(IN HWND hStatusBar, IN INT PartId, IN HINSTANCE hInstance, IN UINT uID)
Definition: misc.c:150
CHAR Message[80]
Definition: alive.c:5
HWND hDependsTreeView1
Definition: precomp.h:139
DWORD LoadAndFormatString(IN HINSTANCE hInstance, IN UINT uID, OUT LPTSTR *lpTarget,...)
Definition: misc.c:86
HWND hTool
Definition: precomp.h:51
LPQUERY_SERVICE_CONFIG GetServiceConfig(LPWSTR lpServiceName)
Definition: query.c:29
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
INT_PTR CALLBACK LogonPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: about.c:13
struct _MENU_HINT MENU_HINT
HMENU hShortcutMenu
Definition: precomp.h:53
BOOL StatusBarLoadAndFormatString(IN HWND hStatusBar, IN INT PartId, IN HINSTANCE hInstance, IN UINT uID,...)
Definition: misc.c:108
struct _SERVICEPROPSHEET SERVICEPROPSHEET
static const WCHAR Control[]
Definition: interface.c:27
HANDLE ProcessHeap
Definition: servman.c:15
BOOL TV1_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName)
VOID TV2_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName)
VOID IncrementProgressBar(HANDLE hProgress, UINT NewPos)
Definition: progress.c:288
BOOL bIsUserAnAdmin
Definition: precomp.h:66
INT_PTR CALLBACK RecoveryPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
BOOL SetServiceConfig(LPQUERY_SERVICE_CONFIG pServiceConfig, LPWSTR lpServiceName, LPWSTR lpPassword)
Definition: query.c:82
struct _DEPENDDATA * PDEPENDDATA
BOOL UpdateServiceStatus(ENUM_SERVICE_STATUS_PROCESS *pService)
Definition: query.c:373
VOID ResourceMessageBox(HINSTANCE hInstance, HWND hwnd, UINT uType, UINT uCaptionId, UINT uMessageId)
Definition: misc.c:283
ENUM_SERVICE_STATUS_PROCESS * pService
Definition: precomp.h:130
ENUM_SERVICE_STATUS_PROCESS * pCurrentService
Definition: precomp.h:57
HWND hMainWnd
Definition: precomp.h:48
HWND hDependsWnd
Definition: precomp.h:138
VOID SetMenuAndButtonStates(PMAIN_WND_INFO Info)
Definition: mainwnd.c:151
struct _MAIN_WND_INFO MAIN_WND_INFO
VOID CompleteProgressBar(HANDLE hProgress)
Definition: progress.c:261
HWND hHeader
Definition: precomp.h:52
BOOL RefreshServiceList(PMAIN_WND_INFO Info)
Definition: listview.c:247
BOOL InitMainWindowImpl(VOID)
Definition: mainwnd.c:961
BOOL bDlgOpen
Definition: precomp.h:64
#define OUT
Definition: typedefs.h:39
INT_PTR CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam)
Definition: progress.c:231
uint32_t * LPDWORD
Definition: typedefs.h:57
LPWSTR GetListOfServicesToStop(LPWSTR lpServiceName)
INT_PTR CALLBACK DependenciesPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
unsigned int ULONG
Definition: retypes.h:1
struct _MENU_HINT * PMENU_HINT
HTREEITEM AddItemToTreeView(HWND hTreeView, HTREEITEM hRoot, LPWSTR lpDisplayName, LPWSTR lpServiceName, ULONG serviceType, BOOL bHasChildren)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
VOID ListViewSelectionChanged(PMAIN_WND_INFO Info, LPNMLISTVIEW pnmv)
Definition: listview.c:48
struct _SERVICEPROPSHEET * PSERVICEPROPSHEET
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
_In_ LPCSTR _Out_writes_to_opt_ cchDisplayName LPSTR lpDisplayName
Definition: winbase.h:2730
LPARAM lParam
Definition: combotst.c:139
PMAIN_WND_INFO Info
Definition: precomp.h:129
VOID SetListViewStyle(HWND hListView, DWORD View)
Definition: listview.c:34
VOID UpdateServiceCount(PMAIN_WND_INFO Info)
Definition: mainwnd.c:124
VOID UninitMainWindowImpl(VOID)
Definition: mainwnd.c:987
HWND hListView
Definition: precomp.h:49
VOID FreeServiceList(PMAIN_WND_INFO Info)
Definition: query.c:257
HIMAGELIST InitImageList(UINT StartResource, UINT EndResource, UINT Width, UINT Height, ULONG type)
Definition: misc.c:219