- Fix displaying the full executable path, plus arguments
- start converting rc file from ResEd output to human readable
Modified: trunk/reactos/subsys/system/servman/En.rc
Modified: trunk/reactos/subsys/system/servman/propsheet.c
Modified: trunk/reactos/subsys/system/servman/query.c
Modified: trunk/reactos/subsys/system/servman/resource.h
_____
Modified: trunk/reactos/subsys/system/servman/En.rc
--- trunk/reactos/subsys/system/servman/En.rc 2006-01-21 14:22:17 UTC
(rev 20960)
+++ trunk/reactos/subsys/system/servman/En.rc 2006-01-21 15:36:11 UTC
(rev 20961)
@@ -52,45 +52,48 @@
MENUITEM "Help",ID_HELP
END
END
+
IDD_ABOUTBOX DIALOGEX 22,16,190,182
CAPTION "About Service Manager"
FONT 8,"Tahoma",0,0
-STYLE 0x00C80080
+STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME
BEGIN
- CONTROL "Service Manager v0.1\nCopyright (C) 2006\nby Ged Murphy
(gedmurphy(a)gmail.com)",IDC_STATIC,"Static",0x1002000C,48,7,130,26
- CONTROL "Close",IDOK,"Button",0x50030001,75,162,44,15
+ LTEXT "Service Manager v0.1\nCopyright (C) 2006\nby Ged Murphy
(gedmurphy(a)gmail.com)", IDC_STATIC, 48, 7, 130, 26
+ PUSHBUTTON "Close", IDOK, 75, 162, 44, 15
CONTROL "",IDI_SM_ICON,"Static",0x50000203,0,12,7,30
- CONTROL "",IDC_LICENSE_EDIT,"Edit",0x50210804,8,44,174,107,0x00000200
+ EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL |
WS_TABSTOP | ES_READONLY | ES_MULTILINE
END
+
IDD_DLG_GENERAL DIALOGEX 6,6,253,225
CAPTION "General"
-FONT 8,"MS Sans Serif",0,0
-STYLE 0x10CF0000
+FONT 8,"Tahoma",0,0
+STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME
| WS_GROUP | WS_TABSTOP
BEGIN
- CONTROL "",IDC_DISP_NAME,"Static",0x50001000,70,29,176,12
- CONTROL "",IDC_DESCRIPTION,"Static",0x50201000,70,46,176,22
- CONTROL "",IDC_EXEPATH,"Static",0x50001000,6,86,238,12
+ LTEXT "", IDC_SERV_NAME, 70,11,176,11, WS_CHILD | WS_VISIBLE
+ EDITTEXT IDC_DISP_NAME, 70, 29, 176, 13, WS_CHILD | WS_VISIBLE |
WS_TABSTOP | ES_READONLY
+ EDITTEXT IDC_DESCRIPTION, 70, 46, 176, 24, WS_CHILD | WS_VISIBLE |
WS_VSCROLL | WS_TABSTOP | ES_MULTILINE | ES_READONLY
+ EDITTEXT IDC_EXEPATH, 6, 86, 240, 13, WS_CHILD | WS_VISIBLE |
WS_TABSTOP | ES_READONLY
CONTROL "",IDC_START_TYPE,"ComboBox",0x50010003,70,107,176,11
- CONTROL "Start",IDC_START,"Button",0x50010000,6,155,54,15
- CONTROL "Stop",IDC_STOP,"Button",0x50010000,68,155,54,15
- CONTROL "Pause",IDC_PAUSE,"Button",0x50010000,130,155,54,15
- CONTROL "Resume",IDC_RESUME,"Button",0x50010000,192,155,54,15
- CONTROL "Service name:",IDC_STATIC,"Static",0x50000000,4,11,53,11
- CONTROL "",IDC_START_PARAM,"Static",0x50001000,70,199,176,11
- CONTROL "Display name:",IDC_STATIC,"Static",0x50000000,4,29,53,11
- CONTROL "Description",IDC_STATIC,"Static",0x50000000,4,51,53,11
- CONTROL "",IDC_SERV_NAME,"Static",0x50000000,70,11,176,11
- CONTROL "Path to
executable:",IDC_STATIC,"Static",0x50000000,6,73,82,9
- CONTROL "Startup type:",IDC_STATIC,"Static",0x50000000,6,108,53,11
- CONTROL "Service status:",IDC_STATIC,"Static",0x50000000,4,138,53,11
+ PUSHBUTTON "Start", IDC_START, 6, 155, 54, 15
+ PUSHBUTTON "Stop", IDC_STOP, 68, 155, 54, 15
+ PUSHBUTTON "Pause", IDC_PAUSE , 130, 155, 54, 15
+ PUSHBUTTON "Resume", IDC_RESUME, 192, 155, 54, 15
+ LTEXT "Service name:", IDC_STATIC, 4, 11, 53, 11
+ LTEXT "Display name:", IDC_STATIC, 4, 29, 53, 11
+ LTEXT "Description", IDC_STATIC, 4, 51, 53, 11
+ LTEXT "Path to executable:", IDC_STATIC, 6, 73, 82, 9
+ LTEXT "Startup type:", IDC_STATIC, 6, 108, 53, 11
+ LTEXT "Service status:", IDC_STATIC, 4, 138, 53, 11
CONTROL "",IDC_SERV_STATUS,"Static",0x50000000,70,138,176,11
- CONTROL "You can specify the start parameters that apply when you
start the service from
here.",IDC_STATIC,"Static",0x50000000,6,177,240,15
- CONTROL "Start parameters",IDC_STATIC,"Static",0x50000000,6,199,53,11
+ LTEXT "You can specify the start parameters that apply when you start
the service from here.",IDC_STATIC, 6,177,240,15
+ LTEXT "Start parameters", IDC_STATIC, 6, 199, 53, 11
+ EDITTEXT IDC_START_PARAM, 68, 199, 178, 13, WS_CHILD | WS_VISIBLE |
WS_TABSTOP
END
+
IDD_DLG_DEPEND DIALOGEX 6,6,253,225
CAPTION "Dependencies"
-FONT 8,"MS Sans Serif",0,0
-STYLE 0x10CF0000
+FONT 8,"Tahoma",0,0
+STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME
| WS_GROUP | WS_TABSTOP
BEGIN
CONTROL
"",IDC_DEPEND_TREE1,"SysTreeView32",0x50010007,8,70,236,68,0x00000200
CONTROL
"",IDC_DEPEND_TREE2,"SysTreeView32",0x50010007,8,151,234,67,0x00000200
@@ -98,10 +101,11 @@
CONTROL "This service depends on the following
components",IDC_STATIC,"Static",0x50000000,8,57,236,9
CONTROL "",IDC_DEPEND_SERVICE,"Static",0x50000000,8,38,236,13
END
+
IDD_DLG_CREATE DIALOGEX 6,6,225,209
CAPTION "Create a service"
-FONT 8,"MS Sans Serif",0,0
-STYLE 0x10CF0000
+FONT 8,"Tahoma",0,0
+STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME
| WS_GROUP | WS_TABSTOP
BEGIN
CONTROL
"",IDC_CREATE_SERVNAME,"Edit",0x50010000,72,12,150,11,0x00000200
CONTROL
"",IDC_CREATE_DISPNAME,"Edit",0x50010000,72,31,150,11,0x00000200
@@ -118,8 +122,21 @@
CONTROL "Help",ID_CREATE_HELP,"Button",0x50010000,6,192,44,13
END
+IDD_DLG_PROGRESS DIALOGEX 6,6,255,89
+CAPTION "Service Control"
+FONT 8,"MS Sans Serif",0,0
+STYLE WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_THICKFRAME
| WS_GROUP | WS_TABSTOP
+BEGIN
+ CONTROL
"",IDC_SERVCON_PROGRESS,"msctls_progress32",0x50000000,8,46,238,13
+ CONTROL "",IDC_SERVCON_INFO,"Static",0x50000000,8,5,236,11
+ CONTROL "",IDC_SERVCON_NAME,"Static",0x50000000,8,25,66,11
+ CONTROL "&Close",IDOK,"Button",0x50010000,100,70,54,13
+END
+
+
IDB_BUTTONS BITMAP DISCARDABLE "res/toolbar.bmp"
+
STRINGTABLE DISCARDABLE
BEGIN
IDS_FIRSTCOLUMN "Name"
@@ -128,6 +145,7 @@
IDS_FOURTHCOLUMN "Startup Type"
IDS_FITHCOLUMN "Log On As"
END
+
STRINGTABLE DISCARDABLE
BEGIN
IDS_SERVICES_STARTED "Started"
@@ -136,11 +154,13 @@
IDS_SERVICES_MAN "Manual"
IDS_SERVICES_DIS "Disabled"
END
+
STRINGTABLE DISCARDABLE
BEGIN
IDS_NUM_SERVICES "Num Services: %d"
- IDS_LICENSE "This program is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.\r\n\r\nThis program is
distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.\r\n\r\nYou should have receive"
+ IDS_LICENSE "This program is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.\r\n\r\nThis program is
distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.\r\n\r\nYou should have received a copy of the GNU
Lesser General Public License along with this library; if not, write to
the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA"
END
+
STRINGTABLE DISCARDABLE
BEGIN
IDS_TOOLTIP_PROP "Properties"
@@ -150,7 +170,12 @@
IDS_TOOLTIP_STOP "Stop service"
IDS_TOOLTIP_PAUSE "Pause service"
IDS_TOOLTIP_RESTART "Restart service"
- IDS_TOOLTIP_NEW "Create new a service"
+ IDS_TOOLTIP_NEW "Create a new service"
IDS_TOOLTIP_HELP "Help"
IDS_TOOLTIP_EXIT "Exit"
END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_PROGRESS_INFO "ReactOS is attempting to %s the following service
on %s"
+END
_____
Modified: trunk/reactos/subsys/system/servman/propsheet.c
--- trunk/reactos/subsys/system/servman/propsheet.c 2006-01-21
14:22:17 UTC (rev 20960)
+++ trunk/reactos/subsys/system/servman/propsheet.c 2006-01-21
15:36:11 UTC (rev 20961)
@@ -115,7 +115,6 @@
(LPARAM)DlgInfo.lpDescription);
- /* FIXME: needs implementing. Use code base at bottom of query.c */
/* set the executable path */
if (GetExecutablePath(&DlgInfo.lpPathToExe))
SendDlgItemMessage(hwndDlg, IDC_EXEPATH, WM_SETTEXT, 0,
(LPARAM)DlgInfo.lpPathToExe);
_____
Modified: trunk/reactos/subsys/system/servman/query.c
--- trunk/reactos/subsys/system/servman/query.c 2006-01-21 14:22:17 UTC
(rev 20960)
+++ trunk/reactos/subsys/system/servman/query.c 2006-01-21 15:36:11 UTC
(rev 20961)
@@ -80,9 +80,7 @@
ENUM_SERVICE_STATUS_PROCESS *Service = NULL;
LVITEM item;
DWORD BytesNeeded = 0;
- TCHAR FileName[MAX_PATH];
-
item.mask = LVIF_PARAM;
item.iItem = GetSelectedItem();
SendMessage(hListView, LVM_GETITEM, 0, (LPARAM)&item);
@@ -131,19 +129,8 @@
}
}
- ZeroMemory(&FileName, MAX_PATH);
- if (_tcscspn(pServiceConfig->lpBinaryPathName, _T("\"")))
- {
- _tcsncpy(FileName, pServiceConfig->lpBinaryPathName,
- _tcscspn(pServiceConfig->lpBinaryPathName, _T(" ")) );
- }
- else
- {
- _tcscpy(FileName, pServiceConfig->lpBinaryPathName);
- }
+ *ExePath = pServiceConfig->lpBinaryPathName;
- *ExePath = FileName;
-
CloseServiceHandle(hSCManager);
CloseServiceHandle(hSc);
_____
Modified: trunk/reactos/subsys/system/servman/resource.h
--- trunk/reactos/subsys/system/servman/resource.h 2006-01-21
14:22:17 UTC (rev 20960)
+++ trunk/reactos/subsys/system/servman/resource.h 2006-01-21
15:36:11 UTC (rev 20961)
@@ -89,10 +89,17 @@
/* create service dialog */
-#define IDD_DLG_CREATE 8000
+#define IDD_DLG_CREATE 8000
#define IDC_CREATE_SERVNAME 8001
#define IDC_CREATE_DISPNAME 8002
-#define IDC_CREATE_PATH 8003
-#define IDC_CREATE_DESC 8004
-#define IDC_CREATE_OPTIONS 8005
-#define ID_CREATE_HELP 8006
+#define IDC_CREATE_PATH 8003
+#define IDC_CREATE_DESC 8004
+#define IDC_CREATE_OPTIONS 8005
+#define ID_CREATE_HELP 8006
+
+/* progress bar */
+#define IDD_DLG_PROGRESS 7000
+#define IDC_SERVCON_PROGRESS 7001
+#define IDC_SERVCON_INFO 7002
+#define IDC_SERVCON_NAME 7003
+#define IDS_PROGRESS_INFO 7004
corret a member name in DD_SURFACECALLBACKS so it is same as ddk
Modified: trunk/reactos/w32api/include/ddk/ddrawint.h
_____
Modified: trunk/reactos/w32api/include/ddk/ddrawint.h
--- trunk/reactos/w32api/include/ddk/ddrawint.h 2006-01-21 02:19:27 UTC
(rev 20959)
+++ trunk/reactos/w32api/include/ddk/ddrawint.h 2006-01-21 14:22:17 UTC
(rev 20960)
@@ -421,7 +421,7 @@
PDD_SURFCB_GETFLIPSTATUS GetFlipStatus;
PDD_SURFCB_UPDATEOVERLAY UpdateOverlay;
PDD_SURFCB_SETOVERLAYPOSITION SetOverlayPosition;
- PVOID Reserved;
+ PVOID reserved4;
PDD_SURFCB_SETPALETTE SetPalette;
} DD_SURFACECALLBACKS, *PDD_SURFACECALLBACKS;
Fixes typeo.
Modified: trunk/reactos/subsys/win32k/objects/text.c
_____
Modified: trunk/reactos/subsys/win32k/objects/text.c
--- trunk/reactos/subsys/win32k/objects/text.c 2006-01-21 00:52:08 UTC
(rev 20958)
+++ trunk/reactos/subsys/win32k/objects/text.c 2006-01-21 02:19:27 UTC
(rev 20959)
@@ -2165,7 +2165,7 @@
/*
- Bassed on "Undocumented W2k Secrets", Table B-2, page 473.
+ Based on "Undocumented W2k Secrets", Table B-2, page 473.
This function does not exist. See note in gdi32/objects/text.c
GetTextCharset. This should be moved to include/win32k/ntgdibad.h.
*/
Port Wine GetCharWidth32A.
Modified: trunk/reactos/lib/gdi32/objects/font.c
_____
Modified: trunk/reactos/lib/gdi32/objects/font.c
--- trunk/reactos/lib/gdi32/objects/font.c 2006-01-21 00:05:59 UTC
(rev 20957)
+++ trunk/reactos/lib/gdi32/objects/font.c 2006-01-21 00:52:08 UTC
(rev 20958)
@@ -15,6 +15,73 @@
#define INITIAL_FAMILY_COUNT 64
+/**********************************************************************
*
+ * FONT_mbtowc
+ *
+ * Returns a Unicode translation of str using the charset of the
+ * currently selected font in hdc. If count is -1 then str is assumed
+ * to be '\0' terminated, otherwise it contains the number of bytes to
+ * convert. If plenW is non-NULL, on return it will point to the
+ * number of WCHARs that have been written. If pCP is non-NULL, on
+ * return it will point to the codepage used in the conversion. The
+ * caller should free the returned LPWSTR from the process heap
+ * itself.
+ */
+static LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW,
UINT *pCP)
+{
+ UINT cp = CP_ACP;
+ INT lenW;
+ LPWSTR strW;
+ CHARSETINFO csi;
+ int charset = GetTextCharset(hdc);
+
+ /* Hmm, nicely designed api this one! */
+ if(NtGdiTranslateCharsetInfo((PDWORD)charset, &csi,
TCI_SRCCHARSET))
+ cp = csi.ciACP;
+ else {
+ switch(charset) {
+ case OEM_CHARSET:
+ cp = GetOEMCP();
+ break;
+ case DEFAULT_CHARSET:
+ cp = GetACP();
+ break;
+
+/* case VISCII_CHARSET:
+ case TCVN_CHARSET:
+ case KOI8_CHARSET:
+ case ISO3_CHARSET:
+ case ISO4_CHARSET:
+ case ISO10_CHARSET:
+ case CELTIC_CHARSET:*/
+ /* FIXME: These have no place here, but because x11drv
+ enumerates fonts with these (made up) charsets some apps
+ might use them and then the FIXME below would become
+ annoying. Now we could pick the intended codepage for
+ each of these, but since it's broken anyway we'll just
+ use CP_ACP and hope it'll go away...
+ */
+ /* cp = CP_ACP;
+ break;*/
+
+ default:
+ DPRINT1("Can't find codepage for charset %d\n", charset);
+ break;
+ }
+ }
+
+ DPRINT("charset %d => cp %d\n", charset, cp);
+
+ if(count == -1) count = strlen(str);
+ lenW = MultiByteToWideChar(cp, 0, str, count, NULL, 0);
+ strW = HeapAlloc(GetProcessHeap(), 0, lenW*sizeof(WCHAR));
+ MultiByteToWideChar(cp, 0, str, count, strW, lenW);
+ if(plenW) *plenW = lenW;
+ if(pCP) *pCP = cp;
+ return strW;
+}
+
+
static BOOL FASTCALL
MetricsCharConvert(WCHAR w, UCHAR *b)
{
@@ -347,8 +414,34 @@
LPINT lpBuffer
)
{
- /* FIXME what to do with iFirstChar and iLastChar ??? */
- return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
+ INT i, wlen, count = (INT)(iLastChar - iFirstChar + 1);
+ LPSTR str;
+ LPWSTR wstr;
+ BOOL ret = TRUE;
+
+ if(count <= 0) return FALSE;
+
+ str = HeapAlloc(GetProcessHeap(), 0, count);
+ for(i = 0; i < count; i++)
+ str[i] = (BYTE)(iFirstChar + i);
+
+ wstr = FONT_mbtowc(hdc, str, count, &wlen, NULL);
+
+ for(i = 0; i < wlen; i++)
+ {
+ /* FIXME should be NtGdiGetCharWidthW */
+ if(!NtGdiGetCharWidth32(hdc, wstr[i], wstr[i], lpBuffer))
+ {
+ ret = FALSE;
+ break;
+ }
+ lpBuffer++;
+ }
+
+ HeapFree(GetProcessHeap(), 0, str);
+ HeapFree(GetProcessHeap(), 0, wstr);
+
+ return ret;
}
@@ -364,6 +457,7 @@
LPINT lpBuffer
)
{
+ /* FIXME should be NtGdiGetCharWidthW */
return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
}
Add notes for NtGdiGetTextCharset.
Modified: trunk/reactos/subsys/win32k/objects/text.c
_____
Modified: trunk/reactos/subsys/win32k/objects/text.c
--- trunk/reactos/subsys/win32k/objects/text.c 2006-01-20 17:50:27 UTC
(rev 20955)
+++ trunk/reactos/subsys/win32k/objects/text.c 2006-01-21 00:04:14 UTC
(rev 20956)
@@ -2163,6 +2163,12 @@
return FALSE;
}
+
+/*
+ Bassed on "Undocumented W2k Secrets", Table B-2, page 473.
+ This function does not exist. See note in gdi32/objects/text.c
+ GetTextCharset. This should be moved to include/win32k/ntgdibad.h.
+*/
UINT
STDCALL
NtGdiGetTextCharset(HDC hDC)