mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 14:53:40 +00:00
- Fix formatting (no code changed)
svn path=/trunk/; revision=36698
This commit is contained in:
parent
c196de6a7f
commit
b1c39670f7
9 changed files with 175 additions and 95 deletions
|
@ -28,7 +28,8 @@ static GENERIC_MAPPING FileGenericMapping =
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static INT
|
static
|
||||||
|
INT
|
||||||
LengthOfStrResource(IN HINSTANCE hInst,
|
LengthOfStrResource(IN HINSTANCE hInst,
|
||||||
IN UINT uID)
|
IN UINT uID)
|
||||||
{
|
{
|
||||||
|
@ -72,7 +73,8 @@ LengthOfStrResource(IN HINSTANCE hInst,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static INT
|
static
|
||||||
|
INT
|
||||||
AllocAndLoadString(OUT LPTSTR *lpTarget,
|
AllocAndLoadString(OUT LPTSTR *lpTarget,
|
||||||
IN HINSTANCE hInst,
|
IN HINSTANCE hInst,
|
||||||
IN UINT uID)
|
IN UINT uID)
|
||||||
|
@ -106,7 +108,8 @@ AllocAndLoadString(OUT LPTSTR *lpTarget,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static
|
||||||
|
VOID
|
||||||
PrintHelp(VOID)
|
PrintHelp(VOID)
|
||||||
{
|
{
|
||||||
LPTSTR szHelp;
|
LPTSTR szHelp;
|
||||||
|
@ -125,7 +128,8 @@ PrintHelp(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static
|
||||||
|
VOID
|
||||||
PrintErrorMessage(IN DWORD dwError)
|
PrintErrorMessage(IN DWORD dwError)
|
||||||
{
|
{
|
||||||
LPTSTR szError;
|
LPTSTR szError;
|
||||||
|
@ -148,7 +152,8 @@ PrintErrorMessage(IN DWORD dwError)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static DWORD
|
static
|
||||||
|
DWORD
|
||||||
LoadAndPrintString(IN HINSTANCE hInst,
|
LoadAndPrintString(IN HINSTANCE hInst,
|
||||||
IN UINT uID)
|
IN UINT uID)
|
||||||
{
|
{
|
||||||
|
@ -170,7 +175,8 @@ LoadAndPrintString(IN HINSTANCE hInst,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static BOOL
|
static
|
||||||
|
BOOL
|
||||||
PrintFileDacl(IN LPTSTR FilePath,
|
PrintFileDacl(IN LPTSTR FilePath,
|
||||||
IN LPTSTR FileName)
|
IN LPTSTR FileName)
|
||||||
{
|
{
|
||||||
|
@ -507,7 +513,9 @@ PrintSpecialAccess:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int __cdecl _tmain(int argc, const TCHAR *argv[])
|
int
|
||||||
|
__cdecl
|
||||||
|
_tmain(int argc, const TCHAR *argv[])
|
||||||
{
|
{
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,44 +1,44 @@
|
||||||
#ifndef _CACLS_RESOURCE_H
|
#ifndef _CACLS_RESOURCE_H
|
||||||
#define _CACLS_RESOURCE_H
|
#define _CACLS_RESOURCE_H
|
||||||
|
|
||||||
#define IDS_HELP 101
|
#define IDS_HELP 101
|
||||||
#define IDS_ABBR_CI 102
|
#define IDS_ABBR_CI 102
|
||||||
#define IDS_ABBR_OI 103
|
#define IDS_ABBR_OI 103
|
||||||
#define IDS_ABBR_IO 104
|
#define IDS_ABBR_IO 104
|
||||||
#define IDS_ABBR_FULL 105
|
#define IDS_ABBR_FULL 105
|
||||||
#define IDS_ABBR_READ 106
|
#define IDS_ABBR_READ 106
|
||||||
#define IDS_ABBR_WRITE 107
|
#define IDS_ABBR_WRITE 107
|
||||||
#define IDS_ABBR_CHANGE 108
|
#define IDS_ABBR_CHANGE 108
|
||||||
#define IDS_ABBR_NONE 109
|
#define IDS_ABBR_NONE 109
|
||||||
#define IDS_ALLOW 110
|
#define IDS_ALLOW 110
|
||||||
#define IDS_DENY 111
|
#define IDS_DENY 111
|
||||||
#define IDS_SPECIAL_ACCESS 112
|
#define IDS_SPECIAL_ACCESS 112
|
||||||
|
|
||||||
#define IDS_GENERIC_READ 113
|
#define IDS_GENERIC_READ 113
|
||||||
#define IDS_GENERIC_WRITE 114
|
#define IDS_GENERIC_WRITE 114
|
||||||
#define IDS_GENERIC_EXECUTE 115
|
#define IDS_GENERIC_EXECUTE 115
|
||||||
#define IDS_GENERIC_ALL 116
|
#define IDS_GENERIC_ALL 116
|
||||||
#define IDS_FILE_GENERIC_EXECUTE 118
|
#define IDS_FILE_GENERIC_EXECUTE 118
|
||||||
#define IDS_FILE_GENERIC_READ 119
|
#define IDS_FILE_GENERIC_READ 119
|
||||||
#define IDS_FILE_GENERIC_WRITE 120
|
#define IDS_FILE_GENERIC_WRITE 120
|
||||||
#define IDS_FILE_READ_DATA 121
|
#define IDS_FILE_READ_DATA 121
|
||||||
#define IDS_FILE_WRITE_DATA 122
|
#define IDS_FILE_WRITE_DATA 122
|
||||||
#define IDS_FILE_APPEND_DATA 123
|
#define IDS_FILE_APPEND_DATA 123
|
||||||
#define IDS_FILE_READ_EA 124
|
#define IDS_FILE_READ_EA 124
|
||||||
#define IDS_FILE_WRITE_EA 125
|
#define IDS_FILE_WRITE_EA 125
|
||||||
#define IDS_FILE_EXECUTE 126
|
#define IDS_FILE_EXECUTE 126
|
||||||
#define IDS_FILE_DELETE_CHILD 127
|
#define IDS_FILE_DELETE_CHILD 127
|
||||||
#define IDS_FILE_READ_ATTRIBUTES 128
|
#define IDS_FILE_READ_ATTRIBUTES 128
|
||||||
#define IDS_FILE_WRITE_ATTRIBUTES 129
|
#define IDS_FILE_WRITE_ATTRIBUTES 129
|
||||||
#define IDS_MAXIMUM_ALLOWED 130
|
#define IDS_MAXIMUM_ALLOWED 130
|
||||||
#define IDS_ACCESS_SYSTEM_SECURITY 131
|
#define IDS_ACCESS_SYSTEM_SECURITY 131
|
||||||
#define IDS_SPECIFIC_RIGHTS_ALL 132
|
#define IDS_SPECIFIC_RIGHTS_ALL 132
|
||||||
#define IDS_STANDARD_RIGHTS_REQUIRED 133
|
#define IDS_STANDARD_RIGHTS_REQUIRED 133
|
||||||
#define IDS_SYNCHRONIZE 134
|
#define IDS_SYNCHRONIZE 134
|
||||||
#define IDS_WRITE_OWNER 135
|
#define IDS_WRITE_OWNER 135
|
||||||
#define IDS_WRITE_DAC 136
|
#define IDS_WRITE_DAC 136
|
||||||
#define IDS_READ_CONTROL 137
|
#define IDS_READ_CONTROL 137
|
||||||
#define IDS_DELETE 138
|
#define IDS_DELETE 138
|
||||||
#define IDS_STANDARD_RIGHTS_ALL 139
|
#define IDS_STANDARD_RIGHTS_ALL 139
|
||||||
|
|
||||||
#endif /* _CACLS_RESOURCE_H */
|
#endif /* _CACLS_RESOURCE_H */
|
||||||
|
|
|
@ -11,7 +11,9 @@
|
||||||
#include <precomp.h>
|
#include <precomp.h>
|
||||||
|
|
||||||
|
|
||||||
static INT_PTR CALLBACK
|
static
|
||||||
|
INT_PTR
|
||||||
|
CALLBACK
|
||||||
AboutDialogProc(HWND hDlg,
|
AboutDialogProc(HWND hDlg,
|
||||||
UINT message,
|
UINT message,
|
||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
|
|
|
@ -14,7 +14,9 @@
|
||||||
HINSTANCE hInstance;
|
HINSTANCE hInstance;
|
||||||
|
|
||||||
/* Font-enumeration callback */
|
/* Font-enumeration callback */
|
||||||
static int CALLBACK
|
static
|
||||||
|
int
|
||||||
|
CALLBACK
|
||||||
EnumFontNames(ENUMLOGFONTEXW *lpelfe,
|
EnumFontNames(ENUMLOGFONTEXW *lpelfe,
|
||||||
NEWTEXTMETRICEXW *lpntme,
|
NEWTEXTMETRICEXW *lpntme,
|
||||||
DWORD FontType,
|
DWORD FontType,
|
||||||
|
@ -55,7 +57,8 @@ EnumFontNames(ENUMLOGFONTEXW *lpelfe,
|
||||||
|
|
||||||
|
|
||||||
/* Initialize the font-list by enumeration all system fonts */
|
/* Initialize the font-list by enumeration all system fonts */
|
||||||
static VOID
|
static
|
||||||
|
VOID
|
||||||
FillFontStyleComboList(HWND hwndCombo)
|
FillFontStyleComboList(HWND hwndCombo)
|
||||||
{
|
{
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
|
@ -90,7 +93,8 @@ FillFontStyleComboList(HWND hwndCombo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static
|
||||||
|
VOID
|
||||||
ChangeMapFont(HWND hDlg)
|
ChangeMapFont(HWND hDlg)
|
||||||
{
|
{
|
||||||
HWND hCombo;
|
HWND hCombo;
|
||||||
|
@ -130,7 +134,8 @@ ChangeMapFont(HWND hDlg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static
|
||||||
|
VOID
|
||||||
AddCharToSelection(HWND hText,
|
AddCharToSelection(HWND hText,
|
||||||
WCHAR ch)
|
WCHAR ch)
|
||||||
{
|
{
|
||||||
|
@ -182,7 +187,9 @@ AddCharToSelection(HWND hText,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static BOOL CALLBACK
|
static
|
||||||
|
BOOL
|
||||||
|
CALLBACK
|
||||||
DlgProc(HWND hDlg,
|
DlgProc(HWND hDlg,
|
||||||
UINT Message,
|
UINT Message,
|
||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
|
@ -331,7 +338,8 @@ DlgProc(HWND hDlg,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
INT WINAPI
|
INT
|
||||||
|
WINAPI
|
||||||
wWinMain(HINSTANCE hInst,
|
wWinMain(HINSTANCE hInst,
|
||||||
HINSTANCE hPrev,
|
HINSTANCE hPrev,
|
||||||
LPWSTR Cmd,
|
LPWSTR Cmd,
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
#include <precomp.h>
|
#include <precomp.h>
|
||||||
|
|
||||||
|
|
||||||
static HFONT
|
static
|
||||||
|
HFONT
|
||||||
SetLrgFont(PMAP infoPtr)
|
SetLrgFont(PMAP infoPtr)
|
||||||
{
|
{
|
||||||
LOGFONTW lf;
|
LOGFONTW lf;
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
static const WCHAR szMapWndClass[] = L"FontMapWnd";
|
static const WCHAR szMapWndClass[] = L"FontMapWnd";
|
||||||
static const WCHAR szLrgCellWndClass[] = L"LrgCellWnd";
|
static const WCHAR szLrgCellWndClass[] = L"LrgCellWnd";
|
||||||
|
|
||||||
static VOID
|
static
|
||||||
|
VOID
|
||||||
TagFontToCell(PCELL pCell,
|
TagFontToCell(PCELL pCell,
|
||||||
WCHAR ch)
|
WCHAR ch)
|
||||||
{
|
{
|
||||||
|
@ -20,7 +21,8 @@ TagFontToCell(PCELL pCell,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static
|
||||||
|
VOID
|
||||||
SetGrid(PMAP infoPtr)
|
SetGrid(PMAP infoPtr)
|
||||||
{
|
{
|
||||||
INT x, y;
|
INT x, y;
|
||||||
|
@ -42,7 +44,8 @@ SetGrid(PMAP infoPtr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID
|
static
|
||||||
|
VOID
|
||||||
DrawActiveCell(PMAP infoPtr,
|
DrawActiveCell(PMAP infoPtr,
|
||||||
HDC hdc)
|
HDC hdc)
|
||||||
{
|
{
|
||||||
|
@ -55,7 +58,8 @@ DrawActiveCell(PMAP infoPtr,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static
|
||||||
|
VOID
|
||||||
DrawGrid(PMAP infoPtr,
|
DrawGrid(PMAP infoPtr,
|
||||||
HDC hdc)
|
HDC hdc)
|
||||||
{
|
{
|
||||||
|
@ -77,7 +81,8 @@ DrawGrid(PMAP infoPtr,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static
|
||||||
|
VOID
|
||||||
FillGrid(PMAP infoPtr,
|
FillGrid(PMAP infoPtr,
|
||||||
HDC hdc)
|
HDC hdc)
|
||||||
{
|
{
|
||||||
|
@ -107,7 +112,8 @@ FillGrid(PMAP infoPtr,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static BOOL
|
static
|
||||||
|
BOOL
|
||||||
CreateLargeCell(PMAP infoPtr)
|
CreateLargeCell(PMAP infoPtr)
|
||||||
{
|
{
|
||||||
RECT rLarge;
|
RECT rLarge;
|
||||||
|
@ -143,7 +149,8 @@ CreateLargeCell(PMAP infoPtr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static
|
||||||
|
VOID
|
||||||
MoveLargeCell(PMAP infoPtr)
|
MoveLargeCell(PMAP infoPtr)
|
||||||
{
|
{
|
||||||
RECT rLarge;
|
RECT rLarge;
|
||||||
|
@ -173,7 +180,8 @@ MoveLargeCell(PMAP infoPtr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static
|
||||||
|
VOID
|
||||||
SetFont(PMAP infoPtr,
|
SetFont(PMAP infoPtr,
|
||||||
LPWSTR lpFontName)
|
LPWSTR lpFontName)
|
||||||
{
|
{
|
||||||
|
@ -202,7 +210,8 @@ SetFont(PMAP infoPtr,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static LRESULT
|
static
|
||||||
|
LRESULT
|
||||||
NotifyParentOfSelection(PMAP infoPtr,
|
NotifyParentOfSelection(PMAP infoPtr,
|
||||||
UINT code,
|
UINT code,
|
||||||
WCHAR ch)
|
WCHAR ch)
|
||||||
|
@ -227,7 +236,8 @@ NotifyParentOfSelection(PMAP infoPtr,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static
|
||||||
|
VOID
|
||||||
OnClick(PMAP infoPtr,
|
OnClick(PMAP infoPtr,
|
||||||
WORD ptx,
|
WORD ptx,
|
||||||
WORD pty)
|
WORD pty)
|
||||||
|
@ -294,7 +304,8 @@ OnClick(PMAP infoPtr,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static BOOL
|
static
|
||||||
|
BOOL
|
||||||
OnCreate(PMAP infoPtr,
|
OnCreate(PMAP infoPtr,
|
||||||
HWND hwnd,
|
HWND hwnd,
|
||||||
HWND hParent)
|
HWND hParent)
|
||||||
|
@ -340,7 +351,8 @@ OnCreate(PMAP infoPtr,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static
|
||||||
|
VOID
|
||||||
OnVScroll(PMAP infoPtr,
|
OnVScroll(PMAP infoPtr,
|
||||||
INT Value,
|
INT Value,
|
||||||
INT Pos)
|
INT Pos)
|
||||||
|
@ -409,7 +421,8 @@ OnVScroll(PMAP infoPtr,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static
|
||||||
|
VOID
|
||||||
OnPaint(PMAP infoPtr,
|
OnPaint(PMAP infoPtr,
|
||||||
WPARAM wParam)
|
WPARAM wParam)
|
||||||
{
|
{
|
||||||
|
@ -451,7 +464,8 @@ OnPaint(PMAP infoPtr,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LRESULT CALLBACK
|
LRESULT
|
||||||
|
CALLBACK
|
||||||
MapWndProc(HWND hwnd,
|
MapWndProc(HWND hwnd,
|
||||||
UINT uMsg,
|
UINT uMsg,
|
||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
#define IDC_STATIC -1
|
#define IDC_STATIC -1
|
||||||
|
|
||||||
#define IDI_ICON 100
|
#define IDI_ICON 100
|
||||||
|
|
||||||
#define IDD_CHARMAP 200
|
#define IDD_CHARMAP 200
|
||||||
#define IDD_ABOUTBOX 201
|
#define IDD_ABOUTBOX 201
|
||||||
|
|
||||||
#define IDC_FONTCOMBO 1001
|
#define IDC_FONTCOMBO 1001
|
||||||
#define IDC_CMHELP 1002
|
#define IDC_CMHELP 1002
|
||||||
#define IDC_FONTMAP 1003
|
#define IDC_FONTMAP 1003
|
||||||
#define IDC_TEXTBOX 1004
|
#define IDC_TEXTBOX 1004
|
||||||
#define IDC_SELECT 1005
|
#define IDC_SELECT 1005
|
||||||
#define IDC_COPY 1006
|
#define IDC_COPY 1006
|
||||||
#define IDC_ADVVIEW 1007
|
#define IDC_ADVVIEW 1007
|
||||||
#define IDC_DISPLAY 1008
|
#define IDC_DISPLAY 1008
|
||||||
#define IDC_LICENSE_EDIT 1009
|
#define IDC_LICENSE_EDIT 1009
|
||||||
|
|
||||||
#define IDS_LICENSE 1010
|
#define IDS_LICENSE 1010
|
||||||
#define IDS_ABOUT 1011
|
#define IDS_ABOUT 1011
|
||||||
|
|
|
@ -13,7 +13,8 @@ static const TCHAR szWindowClass[] = _T("DummyControlClass");
|
||||||
HANDLE hProcessHeap;
|
HANDLE hProcessHeap;
|
||||||
HINSTANCE hInst;
|
HINSTANCE hInst;
|
||||||
|
|
||||||
static INT
|
static
|
||||||
|
INT
|
||||||
OpenShellFolder(LPTSTR lpFolderCLSID)
|
OpenShellFolder(LPTSTR lpFolderCLSID)
|
||||||
{
|
{
|
||||||
TCHAR szParameters[MAX_PATH];
|
TCHAR szParameters[MAX_PATH];
|
||||||
|
@ -23,10 +24,16 @@ OpenShellFolder(LPTSTR lpFolderCLSID)
|
||||||
_tcscpy(szParameters, _T("/n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"));
|
_tcscpy(szParameters, _T("/n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"));
|
||||||
_tcscat(szParameters, lpFolderCLSID);
|
_tcscat(szParameters, lpFolderCLSID);
|
||||||
|
|
||||||
return (int)ShellExecute(NULL, _T("open"), _T("explorer.exe"), szParameters, NULL, SW_SHOWDEFAULT) > 32;
|
return (int) ShellExecute(NULL,
|
||||||
|
_T("open"),
|
||||||
|
_T("explorer.exe"),
|
||||||
|
szParameters,
|
||||||
|
NULL,
|
||||||
|
SW_SHOWDEFAULT) > 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INT
|
static
|
||||||
|
INT
|
||||||
RunControlPanel(LPTSTR lpCmd)
|
RunControlPanel(LPTSTR lpCmd)
|
||||||
{
|
{
|
||||||
TCHAR szParameters[MAX_PATH];
|
TCHAR szParameters[MAX_PATH];
|
||||||
|
@ -37,8 +44,12 @@ RunControlPanel(LPTSTR lpCmd)
|
||||||
return RUNDLL(szParameters);
|
return RUNDLL(szParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WINAPI
|
int
|
||||||
_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
|
WINAPI
|
||||||
|
_tWinMain(HINSTANCE hInstance,
|
||||||
|
HINSTANCE hPrevInstance,
|
||||||
|
LPTSTR lpCmdLine,
|
||||||
|
int nCmdShow)
|
||||||
{
|
{
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
|
|
||||||
|
@ -71,7 +82,11 @@ _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nC
|
||||||
else if (!_tcsicmp(lpCmdLine, _T("userpasswords2"))) return RUNDLL(_T("netplwiz.dll,UsersRunDll")); /* Dialog based advanced User Account Manager */
|
else if (!_tcsicmp(lpCmdLine, _T("userpasswords2"))) return RUNDLL(_T("netplwiz.dll,UsersRunDll")); /* Dialog based advanced User Account Manager */
|
||||||
|
|
||||||
/* It is none of them, so look for a handler in the registry */
|
/* It is none of them, so look for a handler in the registry */
|
||||||
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls"), 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
|
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||||
|
_T("Software\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls"),
|
||||||
|
0,
|
||||||
|
KEY_QUERY_VALUE,
|
||||||
|
&hKey) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
DWORD dwIndex;
|
DWORD dwIndex;
|
||||||
|
|
||||||
|
@ -82,7 +97,14 @@ _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nC
|
||||||
TCHAR szValueName[MAX_VALUE_NAME];
|
TCHAR szValueName[MAX_VALUE_NAME];
|
||||||
|
|
||||||
/* Get the value name and data size */
|
/* Get the value name and data size */
|
||||||
if(RegEnumValue(hKey, dwIndex, szValueName, &dwValueSize, 0, NULL, NULL, &dwDataSize) != ERROR_SUCCESS)
|
if(RegEnumValue(hKey,
|
||||||
|
dwIndex,
|
||||||
|
szValueName,
|
||||||
|
&dwValueSize,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&dwDataSize) != ERROR_SUCCESS)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Check if the parameter is the value name */
|
/* Check if the parameter is the value name */
|
||||||
|
@ -91,11 +113,18 @@ _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nC
|
||||||
LPTSTR pszData;
|
LPTSTR pszData;
|
||||||
|
|
||||||
/* Allocate memory for the data plus two more characters, so we can quote the file name if required */
|
/* Allocate memory for the data plus two more characters, so we can quote the file name if required */
|
||||||
pszData = (LPTSTR) HeapAlloc(hProcessHeap, 0, dwDataSize + 2 * sizeof(TCHAR));
|
pszData = (LPTSTR) HeapAlloc(hProcessHeap,
|
||||||
|
0,
|
||||||
|
dwDataSize + 2 * sizeof(TCHAR));
|
||||||
++pszData;
|
++pszData;
|
||||||
|
|
||||||
/* This value is the one we are looking for, so get the data. It is the path to a .cpl file */
|
/* This value is the one we are looking for, so get the data. It is the path to a .cpl file */
|
||||||
if(RegQueryValueEx(hKey, szValueName, 0, NULL, (LPBYTE)pszData, &dwDataSize) == ERROR_SUCCESS)
|
if(RegQueryValueEx(hKey,
|
||||||
|
szValueName,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
(LPBYTE)pszData,
|
||||||
|
&dwDataSize) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
INT nReturnValue;
|
INT nReturnValue;
|
||||||
|
|
||||||
|
@ -108,13 +137,17 @@ _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nC
|
||||||
}
|
}
|
||||||
|
|
||||||
nReturnValue = RunControlPanel(pszData);
|
nReturnValue = RunControlPanel(pszData);
|
||||||
HeapFree(hProcessHeap, 0, pszData);
|
HeapFree(hProcessHeap,
|
||||||
|
0,
|
||||||
|
pszData);
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
|
|
||||||
return nReturnValue;
|
return nReturnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
HeapFree(hProcessHeap, 0, pszData);
|
HeapFree(hProcessHeap,
|
||||||
|
0,
|
||||||
|
pszData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,19 +5,33 @@
|
||||||
|
|
||||||
#define REGEDIT _T("regedit.exe")
|
#define REGEDIT _T("regedit.exe")
|
||||||
|
|
||||||
int WINAPI _tWinMain(HINSTANCE hCurInst, HINSTANCE hPrevInst,
|
int
|
||||||
LPTSTR lpsCmdLine, int nCmdShow)
|
WINAPI
|
||||||
|
_tWinMain(HINSTANCE hCurInst,
|
||||||
|
HINSTANCE hPrevInst,
|
||||||
|
LPTSTR lpsCmdLine,
|
||||||
|
int nCmdShow)
|
||||||
{
|
{
|
||||||
TCHAR szPath[MAX_PATH];
|
TCHAR szPath[MAX_PATH];
|
||||||
|
|
||||||
if(GetWindowsDirectory(szPath, MAX_PATH))
|
if(GetWindowsDirectory(szPath, MAX_PATH))
|
||||||
{
|
{
|
||||||
PathAppend(szPath, REGEDIT);
|
PathAppend(szPath, REGEDIT);
|
||||||
ShellExecute(NULL, NULL, szPath, lpsCmdLine, NULL, nCmdShow);
|
ShellExecute(NULL,
|
||||||
|
NULL,
|
||||||
|
szPath,
|
||||||
|
lpsCmdLine,
|
||||||
|
NULL,
|
||||||
|
nCmdShow);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ShellExecute(NULL, NULL, REGEDIT, lpsCmdLine, NULL, nCmdShow);
|
ShellExecute(NULL,
|
||||||
|
NULL,
|
||||||
|
REGEDIT,
|
||||||
|
lpsCmdLine,
|
||||||
|
NULL,
|
||||||
|
nCmdShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue