ReactOS 0.4.15-dev-8191-gbc6c731
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#define LVMAX 5
35
36#define IMAGE_UNKNOWN 0
37#define IMAGE_SERVICE 1
38#define IMAGE_DRIVER 2
39
40#define ACTION_START 1
41#define ACTION_STOP 2
42#define ACTION_PAUSE 3
43#define ACTION_RESUME 4
44#define ACTION_RESTART 5
45
46#define ORD_ASCENDING 1
47#define ORD_DESCENDING -1
48
49typedef struct _MAIN_WND_INFO
50{
58
62
63 INT SelectedItem;/* selection number in the list view */
66
70
72
74
75
80
81
82/* servman.c */
83extern HINSTANCE hInstance;
84extern HANDLE ProcessHeap;
85
86/* mainwnd.c */
87typedef struct _MENU_HINT
88{
92
98HWND CreateMainWindow(LPCTSTR lpCaption, int nCmdShow);
99
100/* listview.c */
101VOID SetListViewStyle(HWND hListView, DWORD View);
104
105/* start / stop / control */
106DWORD DoStartService(LPWSTR ServiceName, HANDLE hProgress, LPWSTR lpStartParams);
109
110/* progress.c */
111#define DEFAULT_STEP 0
113VOID IncrementProgressBar(HANDLE hProgress, UINT NewPos);
115
116/* query.c */
119BOOL SetServiceConfig(LPQUERY_SERVICE_CONFIG pServiceConfig, LPWSTR lpServiceName, LPWSTR lpPassword);
120LPWSTR GetServiceDescription(LPWSTR lpServiceName);
121BOOL SetServiceDescription(LPWSTR lpServiceName, LPWSTR lpDescription);
127
128/* propsheet.c */
129typedef struct _SERVICEPROPSHEET
130{
133
135
136typedef struct _DEPENDDATA
137{
143
145
146
147HTREEITEM AddItemToTreeView(HWND hTreeView, HTREEITEM hRoot, LPWSTR lpDisplayName, LPWSTR lpServiceName, ULONG serviceType, BOOL bHasChildren);
148
149/* stop_dependencies */
152BOOL
155LPWSTR DisplayName,
156LPWSTR ServiceList);
157
158/* tv1_dependencies */
159BOOL TV1_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName);
160VOID TV1_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName);
161
162/* tv2_dependencies */
163BOOL TV2_Initialize(PDEPENDDATA pDependData, LPWSTR lpServiceName);
164VOID TV2_AddDependantsToTree(PDEPENDDATA pDependData, HTREEITEM hParent, LPWSTR lpServiceName);
166LPENUM_SERVICE_STATUS TV2_GetDependants(LPWSTR lpServiceName, LPDWORD lpdwCount);
167
169
170/* propsheet window procs */
172 UINT uMsg,
174 LPARAM lParam);
176 UINT uMsg,
178 LPARAM lParam);
180 UINT uMsg,
182 LPARAM lParam);
184 UINT uMsg,
186 LPARAM lParam);
187
188/* export.c */
190
191/* misc.c */
194 IN UINT uID);
196 IN UINT uID,
197 OUT LPWSTR *lpTarget,
198 ...);
200 IN INT PartId,
202 IN UINT uID,
203 ...);
205 IN INT PartId,
207 IN UINT uID);
209 IN HWND hDlg,
210 IN UINT Res);
213HIMAGELIST InitImageList(UINT StartResource,
214 UINT EndResource,
215 UINT Width,
216 UINT Height,
217 ULONG type);
218VOID
221 HWND hwnd,
222 UINT uType,
223 UINT uCaptionId,
224 UINT uMessageId);
225
226#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:990
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:108
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:964
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
HWND hStatusBar
Definition: main.c:36
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
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:63
unsigned int UINT
Definition: ndis.h:50
PSERVICEPROPSHEET pDlgInfo
Definition: precomp.h:138
HWND hDependsTreeView1
Definition: precomp.h:141
HIMAGELIST hDependsImageList
Definition: precomp.h:139
HWND hDependsTreeView2
Definition: precomp.h:142
HWND hDependsWnd
Definition: precomp.h:140
HWND hTool
Definition: precomp.h:54
PVOID pTag
Definition: precomp.h:71
INT SelectedItem
Definition: precomp.h:63
HMENU hShortcutMenu
Definition: precomp.h:56
HWND hStatus
Definition: precomp.h:53
HWND hHeader
Definition: precomp.h:55
HWND hMainWnd
Definition: precomp.h:51
BOOL bDlgOpen
Definition: precomp.h:67
HWND hListView
Definition: precomp.h:52
ENUM_SERVICE_STATUS_PROCESS * pAllServices
Definition: precomp.h:59
ENUM_SERVICE_STATUS_PROCESS * pCurrentService
Definition: precomp.h:60
DWORD NumServices
Definition: precomp.h:61
BOOL bIsUserAnAdmin
Definition: precomp.h:69
INT SortDirection
Definition: precomp.h:65
BOOL bInMenuLoop
Definition: precomp.h:68
INT SortSelection
Definition: precomp.h:64
int nCmdShow
Definition: precomp.h:57
UINT HintId
Definition: precomp.h:90
WORD CmdId
Definition: precomp.h:89
ENUM_SERVICE_STATUS_PROCESS * pService
Definition: precomp.h:132
PMAIN_WND_INFO Info
Definition: precomp.h:131
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:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
_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:2790
_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