- Fix formatting (no code changed)

svn path=/trunk/; revision=36698
This commit is contained in:
Dmitry Chapyshev 2008-10-08 16:26:50 +00:00
parent c196de6a7f
commit b1c39670f7
9 changed files with 175 additions and 95 deletions

View file

@ -28,7 +28,8 @@ static GENERIC_MAPPING FileGenericMapping =
};
static INT
static
INT
LengthOfStrResource(IN HINSTANCE hInst,
IN UINT uID)
{
@ -72,7 +73,8 @@ LengthOfStrResource(IN HINSTANCE hInst,
}
static INT
static
INT
AllocAndLoadString(OUT LPTSTR *lpTarget,
IN HINSTANCE hInst,
IN UINT uID)
@ -106,7 +108,8 @@ AllocAndLoadString(OUT LPTSTR *lpTarget,
}
static VOID
static
VOID
PrintHelp(VOID)
{
LPTSTR szHelp;
@ -125,7 +128,8 @@ PrintHelp(VOID)
}
static VOID
static
VOID
PrintErrorMessage(IN DWORD dwError)
{
LPTSTR szError;
@ -148,7 +152,8 @@ PrintErrorMessage(IN DWORD dwError)
}
static DWORD
static
DWORD
LoadAndPrintString(IN HINSTANCE hInst,
IN UINT uID)
{
@ -170,7 +175,8 @@ LoadAndPrintString(IN HINSTANCE hInst,
}
static BOOL
static
BOOL
PrintFileDacl(IN LPTSTR FilePath,
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)
{

View file

@ -1,44 +1,44 @@
#ifndef _CACLS_RESOURCE_H
#define _CACLS_RESOURCE_H
#define IDS_HELP 101
#define IDS_ABBR_CI 102
#define IDS_ABBR_OI 103
#define IDS_ABBR_IO 104
#define IDS_ABBR_FULL 105
#define IDS_ABBR_READ 106
#define IDS_ABBR_WRITE 107
#define IDS_ABBR_CHANGE 108
#define IDS_ABBR_NONE 109
#define IDS_ALLOW 110
#define IDS_DENY 111
#define IDS_SPECIAL_ACCESS 112
#define IDS_HELP 101
#define IDS_ABBR_CI 102
#define IDS_ABBR_OI 103
#define IDS_ABBR_IO 104
#define IDS_ABBR_FULL 105
#define IDS_ABBR_READ 106
#define IDS_ABBR_WRITE 107
#define IDS_ABBR_CHANGE 108
#define IDS_ABBR_NONE 109
#define IDS_ALLOW 110
#define IDS_DENY 111
#define IDS_SPECIAL_ACCESS 112
#define IDS_GENERIC_READ 113
#define IDS_GENERIC_WRITE 114
#define IDS_GENERIC_EXECUTE 115
#define IDS_GENERIC_ALL 116
#define IDS_FILE_GENERIC_EXECUTE 118
#define IDS_FILE_GENERIC_READ 119
#define IDS_FILE_GENERIC_WRITE 120
#define IDS_FILE_READ_DATA 121
#define IDS_FILE_WRITE_DATA 122
#define IDS_FILE_APPEND_DATA 123
#define IDS_FILE_READ_EA 124
#define IDS_FILE_WRITE_EA 125
#define IDS_FILE_EXECUTE 126
#define IDS_FILE_DELETE_CHILD 127
#define IDS_FILE_READ_ATTRIBUTES 128
#define IDS_FILE_WRITE_ATTRIBUTES 129
#define IDS_MAXIMUM_ALLOWED 130
#define IDS_ACCESS_SYSTEM_SECURITY 131
#define IDS_SPECIFIC_RIGHTS_ALL 132
#define IDS_GENERIC_READ 113
#define IDS_GENERIC_WRITE 114
#define IDS_GENERIC_EXECUTE 115
#define IDS_GENERIC_ALL 116
#define IDS_FILE_GENERIC_EXECUTE 118
#define IDS_FILE_GENERIC_READ 119
#define IDS_FILE_GENERIC_WRITE 120
#define IDS_FILE_READ_DATA 121
#define IDS_FILE_WRITE_DATA 122
#define IDS_FILE_APPEND_DATA 123
#define IDS_FILE_READ_EA 124
#define IDS_FILE_WRITE_EA 125
#define IDS_FILE_EXECUTE 126
#define IDS_FILE_DELETE_CHILD 127
#define IDS_FILE_READ_ATTRIBUTES 128
#define IDS_FILE_WRITE_ATTRIBUTES 129
#define IDS_MAXIMUM_ALLOWED 130
#define IDS_ACCESS_SYSTEM_SECURITY 131
#define IDS_SPECIFIC_RIGHTS_ALL 132
#define IDS_STANDARD_RIGHTS_REQUIRED 133
#define IDS_SYNCHRONIZE 134
#define IDS_WRITE_OWNER 135
#define IDS_WRITE_DAC 136
#define IDS_READ_CONTROL 137
#define IDS_DELETE 138
#define IDS_STANDARD_RIGHTS_ALL 139
#define IDS_SYNCHRONIZE 134
#define IDS_WRITE_OWNER 135
#define IDS_WRITE_DAC 136
#define IDS_READ_CONTROL 137
#define IDS_DELETE 138
#define IDS_STANDARD_RIGHTS_ALL 139
#endif /* _CACLS_RESOURCE_H */

View file

@ -11,7 +11,9 @@
#include <precomp.h>
static INT_PTR CALLBACK
static
INT_PTR
CALLBACK
AboutDialogProc(HWND hDlg,
UINT message,
WPARAM wParam,

View file

@ -14,7 +14,9 @@
HINSTANCE hInstance;
/* Font-enumeration callback */
static int CALLBACK
static
int
CALLBACK
EnumFontNames(ENUMLOGFONTEXW *lpelfe,
NEWTEXTMETRICEXW *lpntme,
DWORD FontType,
@ -55,7 +57,8 @@ EnumFontNames(ENUMLOGFONTEXW *lpelfe,
/* Initialize the font-list by enumeration all system fonts */
static VOID
static
VOID
FillFontStyleComboList(HWND hwndCombo)
{
HDC hdc;
@ -90,7 +93,8 @@ FillFontStyleComboList(HWND hwndCombo)
}
static VOID
static
VOID
ChangeMapFont(HWND hDlg)
{
HWND hCombo;
@ -130,7 +134,8 @@ ChangeMapFont(HWND hDlg)
}
static VOID
static
VOID
AddCharToSelection(HWND hText,
WCHAR ch)
{
@ -182,7 +187,9 @@ AddCharToSelection(HWND hText,
}
static BOOL CALLBACK
static
BOOL
CALLBACK
DlgProc(HWND hDlg,
UINT Message,
WPARAM wParam,
@ -331,7 +338,8 @@ DlgProc(HWND hDlg,
}
INT WINAPI
INT
WINAPI
wWinMain(HINSTANCE hInst,
HINSTANCE hPrev,
LPWSTR Cmd,

View file

@ -10,7 +10,8 @@
#include <precomp.h>
static HFONT
static
HFONT
SetLrgFont(PMAP infoPtr)
{
LOGFONTW lf;

View file

@ -12,7 +12,8 @@
static const WCHAR szMapWndClass[] = L"FontMapWnd";
static const WCHAR szLrgCellWndClass[] = L"LrgCellWnd";
static VOID
static
VOID
TagFontToCell(PCELL pCell,
WCHAR ch)
{
@ -20,7 +21,8 @@ TagFontToCell(PCELL pCell,
}
static VOID
static
VOID
SetGrid(PMAP infoPtr)
{
INT x, y;
@ -42,7 +44,8 @@ SetGrid(PMAP infoPtr)
}
}
static VOID
static
VOID
DrawActiveCell(PMAP infoPtr,
HDC hdc)
{
@ -55,7 +58,8 @@ DrawActiveCell(PMAP infoPtr,
}
static VOID
static
VOID
DrawGrid(PMAP infoPtr,
HDC hdc)
{
@ -77,7 +81,8 @@ DrawGrid(PMAP infoPtr,
}
static VOID
static
VOID
FillGrid(PMAP infoPtr,
HDC hdc)
{
@ -107,7 +112,8 @@ FillGrid(PMAP infoPtr,
}
static BOOL
static
BOOL
CreateLargeCell(PMAP infoPtr)
{
RECT rLarge;
@ -143,7 +149,8 @@ CreateLargeCell(PMAP infoPtr)
}
static VOID
static
VOID
MoveLargeCell(PMAP infoPtr)
{
RECT rLarge;
@ -173,7 +180,8 @@ MoveLargeCell(PMAP infoPtr)
}
static VOID
static
VOID
SetFont(PMAP infoPtr,
LPWSTR lpFontName)
{
@ -202,7 +210,8 @@ SetFont(PMAP infoPtr,
}
static LRESULT
static
LRESULT
NotifyParentOfSelection(PMAP infoPtr,
UINT code,
WCHAR ch)
@ -227,7 +236,8 @@ NotifyParentOfSelection(PMAP infoPtr,
}
static VOID
static
VOID
OnClick(PMAP infoPtr,
WORD ptx,
WORD pty)
@ -294,7 +304,8 @@ OnClick(PMAP infoPtr,
}
static BOOL
static
BOOL
OnCreate(PMAP infoPtr,
HWND hwnd,
HWND hParent)
@ -340,7 +351,8 @@ OnCreate(PMAP infoPtr,
}
static VOID
static
VOID
OnVScroll(PMAP infoPtr,
INT Value,
INT Pos)
@ -409,7 +421,8 @@ OnVScroll(PMAP infoPtr,
}
static VOID
static
VOID
OnPaint(PMAP infoPtr,
WPARAM wParam)
{
@ -451,7 +464,8 @@ OnPaint(PMAP infoPtr,
}
LRESULT CALLBACK
LRESULT
CALLBACK
MapWndProc(HWND hwnd,
UINT uMsg,
WPARAM wParam,

View file

@ -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_ABOUTBOX 201
#define IDD_CHARMAP 200
#define IDD_ABOUTBOX 201
#define IDC_FONTCOMBO 1001
#define IDC_CMHELP 1002
#define IDC_FONTMAP 1003
#define IDC_TEXTBOX 1004
#define IDC_SELECT 1005
#define IDC_COPY 1006
#define IDC_ADVVIEW 1007
#define IDC_DISPLAY 1008
#define IDC_FONTCOMBO 1001
#define IDC_CMHELP 1002
#define IDC_FONTMAP 1003
#define IDC_TEXTBOX 1004
#define IDC_SELECT 1005
#define IDC_COPY 1006
#define IDC_ADVVIEW 1007
#define IDC_DISPLAY 1008
#define IDC_LICENSE_EDIT 1009
#define IDS_LICENSE 1010
#define IDS_ABOUT 1011
#define IDS_LICENSE 1010
#define IDS_ABOUT 1011

View file

@ -13,7 +13,8 @@ static const TCHAR szWindowClass[] = _T("DummyControlClass");
HANDLE hProcessHeap;
HINSTANCE hInst;
static INT
static
INT
OpenShellFolder(LPTSTR lpFolderCLSID)
{
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}"));
_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)
{
TCHAR szParameters[MAX_PATH];
@ -37,8 +44,12 @@ RunControlPanel(LPTSTR lpCmd)
return RUNDLL(szParameters);
}
int WINAPI
_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
int
WINAPI
_tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
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 */
/* 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;
@ -82,7 +97,14 @@ _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nC
TCHAR szValueName[MAX_VALUE_NAME];
/* 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;
/* Check if the parameter is the value name */
@ -91,11 +113,18 @@ _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nC
LPTSTR pszData;
/* 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;
/* 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;
@ -108,13 +137,17 @@ _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nC
}
nReturnValue = RunControlPanel(pszData);
HeapFree(hProcessHeap, 0, pszData);
HeapFree(hProcessHeap,
0,
pszData);
RegCloseKey(hKey);
return nReturnValue;
}
HeapFree(hProcessHeap, 0, pszData);
HeapFree(hProcessHeap,
0,
pszData);
}
}

View file

@ -5,19 +5,33 @@
#define REGEDIT _T("regedit.exe")
int WINAPI _tWinMain(HINSTANCE hCurInst, HINSTANCE hPrevInst,
LPTSTR lpsCmdLine, int nCmdShow)
int
WINAPI
_tWinMain(HINSTANCE hCurInst,
HINSTANCE hPrevInst,
LPTSTR lpsCmdLine,
int nCmdShow)
{
TCHAR szPath[MAX_PATH];
if(GetWindowsDirectory(szPath, MAX_PATH))
{
PathAppend(szPath, REGEDIT);
ShellExecute(NULL, NULL, szPath, lpsCmdLine, NULL, nCmdShow);
ShellExecute(NULL,
NULL,
szPath,
lpsCmdLine,
NULL,
nCmdShow);
}
else
{
ShellExecute(NULL, NULL, REGEDIT, lpsCmdLine, NULL, nCmdShow);
ShellExecute(NULL,
NULL,
REGEDIT,
lpsCmdLine,
NULL,
nCmdShow);
}
return 0;