fixed about 70 warnings (msvc /W4)

svn path=/trunk/; revision=22892
This commit is contained in:
Christoph von Wittich 2006-07-06 16:25:42 +00:00
parent e0f209d6c1
commit 305978e29e
9 changed files with 99 additions and 54 deletions

View file

@ -67,7 +67,8 @@ static void draw_splitbar(HWND hWnd, int x)
static void ResizeWnd(ChildWnd* pChildWnd, int cx, int cy)
{
HDWP hdwp = BeginDeferWindowPos(2);
RECT rt = {0, 0, cx, cy};
RECT rt;
SetRect(&rt, 0, 0, cx, cy);
cx = pChildWnd->nSplitPos + SPLIT_WIDTH/2;
DeferWindowPos(hdwp, pChildWnd->hTreeWnd, 0, rt.left, rt.top, pChildWnd->nSplitPos-SPLIT_WIDTH/2-rt.left, rt.bottom-rt.top, SWP_NOZORDER|SWP_NOACTIVATE);
@ -103,6 +104,8 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LPCTSTR keyPath, s;
WORD wID = LOWORD(wParam);
UNREFERENCED_PARAMETER(message);
switch (wID) {
/* Parse the menu selections: */
case ID_REGISTRY_EXIT:
@ -209,12 +212,12 @@ static void SuggestKeys(HKEY hRootKey, LPCTSTR pszKeyPath, LPTSTR pszSuggestions
{
if (RegOpenKey(hRootKey, szBuffer, &hOtherKey) == ERROR_SUCCESS)
{
lstrcpyn(pszSuggestions, TEXT("HKCR\\"), iSuggestionsLength);
lstrcpyn(pszSuggestions, TEXT("HKCR\\"), (int) iSuggestionsLength);
i = _tcslen(pszSuggestions);
pszSuggestions += i;
iSuggestionsLength -= i;
lstrcpyn(pszSuggestions, szBuffer, iSuggestionsLength);
lstrcpyn(pszSuggestions, szBuffer, (int) iSuggestionsLength);
i = MIN(_tcslen(pszSuggestions) + 1, iSuggestionsLength);
pszSuggestions += i;
iSuggestionsLength -= i;
@ -235,12 +238,12 @@ static void SuggestKeys(HKEY hRootKey, LPCTSTR pszKeyPath, LPTSTR pszSuggestions
if (RegQueryStringValue(hSubKey, TEXT("CLSID"), NULL,
szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0])) == ERROR_SUCCESS)
{
lstrcpyn(pszSuggestions, TEXT("HKCR\\CLSID\\"), iSuggestionsLength);
lstrcpyn(pszSuggestions, TEXT("HKCR\\CLSID\\"), (int) iSuggestionsLength);
i = _tcslen(pszSuggestions);
pszSuggestions += i;
iSuggestionsLength -= i;
lstrcpyn(pszSuggestions, szBuffer, iSuggestionsLength);
lstrcpyn(pszSuggestions, szBuffer, (int) iSuggestionsLength);
i = MIN(_tcslen(pszSuggestions) + 1, iSuggestionsLength);
pszSuggestions += i;
iSuggestionsLength -= i;
@ -263,7 +266,7 @@ static void SuggestKeys(HKEY hRootKey, LPCTSTR pszKeyPath, LPTSTR pszSuggestions
*/
LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static short last_split;
static int last_split;
BOOL Result;
ChildWnd* pChildWnd = g_pChildWnd;
@ -432,7 +435,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
_T("Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Regedit"),
&hKey) == ERROR_SUCCESS)
{
RegSetValueEx(hKey, _T("LastKey"), 0, REG_SZ, (LPBYTE) szBuffer, _tcslen(szBuffer) * sizeof(szBuffer[0]));
RegSetValueEx(hKey, _T("LastKey"), 0, REG_SZ, (LPBYTE) szBuffer, (DWORD) _tcslen(szBuffer) * sizeof(szBuffer[0]));
RegCloseKey(hKey);
}
}

View file

@ -103,6 +103,8 @@ INT_PTR CALLBACK modify_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
HWND hwndValue;
int len;
UNREFERENCED_PARAMETER(lParam);
switch(uMsg) {
case WM_INITDIALOG:
if(editValueName && _tcscmp(editValueName, _T("")))
@ -168,6 +170,8 @@ INT_PTR CALLBACK modify_multi_string_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wPa
HWND hwndValue;
int len;
UNREFERENCED_PARAMETER(lParam);
switch(uMsg) {
case WM_INITDIALOG:
if(editValueName && _tcscmp(editValueName, _T("")))
@ -238,7 +242,7 @@ LRESULT CALLBACK DwordEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPAR
case WM_CHAR:
if (dwordEditMode == EDIT_MODE_DEC)
{
if (isdigit(wParam & 0xff))
if (isdigit((int) wParam & 0xff))
{
break;
}
@ -249,7 +253,7 @@ LRESULT CALLBACK DwordEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPAR
}
else if (dwordEditMode == EDIT_MODE_HEX)
{
if (isxdigit(wParam & 0xff))
if (isxdigit((int) wParam & 0xff))
{
break;
}
@ -278,6 +282,8 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
DWORD Base;
DWORD Value = 0;
UNREFERENCED_PARAMETER(lParam);
switch(uMsg) {
case WM_INITDIALOG:
dwordEditMode = EDIT_MODE_HEX;
@ -384,6 +390,8 @@ INT_PTR CALLBACK modify_binary_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
HWND hwndValue;
UINT len;
UNREFERENCED_PARAMETER(lParam);
switch(uMsg) {
case WM_INITDIALOG:
if(editValueName && _tcscmp(editValueName, _T("")))
@ -408,7 +416,7 @@ INT_PTR CALLBACK modify_binary_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
case IDOK:
if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
{
len = HexEdit_GetBufferSize(hwndValue);
len = (UINT) HexEdit_GetBufferSize(hwndValue);
if (len != valueDataLen && len > 0)
{
binValueData = HeapReAlloc(GetProcessHeap(), 0, binValueData, len);
@ -482,7 +490,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
{
if (stringValueData)
{
lRet = RegSetValueEx(hKey, valueName, 0, type, (LPBYTE)stringValueData, (_tcslen(stringValueData) + 1) * sizeof(TCHAR));
lRet = RegSetValueEx(hKey, valueName, 0, type, (LPBYTE)stringValueData, (DWORD) (_tcslen(stringValueData) + 1) * sizeof(TCHAR));
}
else
{
@ -496,7 +504,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
{
if (valueDataLen > 0)
{
DWORD llen, listlen, nl_len;
size_t llen, listlen, nl_len;
LPTSTR src, lines = NULL;
if (!(stringValueData = HeapAlloc(GetProcessHeap(), 0, valueDataLen)))
@ -542,7 +550,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
/* convert \r\n to \0 */
BOOL EmptyLines = FALSE;
LPTSTR src, lines, nl;
DWORD linechars, buflen, c_nl, dest;
size_t linechars, buflen, c_nl, dest;
src = stringValueData;
buflen = sizeof(TCHAR);
@ -586,7 +594,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName, BOOL EditBin)
warning(hwnd, IDS_MULTI_SZ_EMPTY_STRING);
}
lRet = RegSetValueEx(hKey, valueName, 0, type, (LPBYTE)lines, buflen);
lRet = RegSetValueEx(hKey, valueName, 0, type, (LPBYTE)lines, (DWORD) buflen);
HeapFree(GetProcessHeap(), 0, lines);
}
else

View file

@ -76,6 +76,9 @@ static void SetFindFlags(DWORD dwFlags)
static INT_PTR CALLBACK AbortFindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
UNREFERENCED_PARAMETER(hDlg);
switch(uMsg)
{
case WM_CLOSE:
@ -102,6 +105,7 @@ static INT_PTR CALLBACK AbortFindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam,
static BOOL RegSearchProc(LPVOID lpParam)
{
MSG msg;
UNREFERENCED_PARAMETER(lpParam);
if (s_hwndAbortDialog && PeekMessage(&msg, s_hwndAbortDialog, 0, 0, PM_REMOVE))
{

View file

@ -119,6 +119,7 @@ done:
static void OnEnterMenuLoop(HWND hWnd)
{
int nParts;
UNREFERENCED_PARAMETER(hWnd);
/* Update the status bar pane sizes */
nParts = -1;
@ -191,6 +192,7 @@ static void toggle_child(HWND hWnd, UINT cmd, HWND hchild)
static BOOL CheckCommDlgError(HWND hWnd)
{
DWORD dwErrorCode = CommDlgExtendedError();
UNREFERENCED_PARAMETER(hWnd);
switch (dwErrorCode) {
case CDERR_DIALOGFAILURE:
break;
@ -347,6 +349,8 @@ static UINT_PTR CALLBACK ExportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, W
LPTSTR pszSelectedKey;
OFNOTIFY *pOfnNotify;
UNREFERENCED_PARAMETER(wParam);
switch(uiMsg) {
case WM_INITDIALOG:
pOfn = (OPENFILENAME *) lParam;
@ -453,6 +457,7 @@ BOOL PrintRegistryHive(HWND hWnd, LPTSTR path)
{
#if 1
PRINTDLG pd;
UNREFERENCED_PARAMETER(path);
ZeroMemory(&pd, sizeof(PRINTDLG));
pd.lStructSize = sizeof(PRINTDLG);
@ -714,7 +719,7 @@ InvokeRemoteRegistryPickerDialog(IN IDsObjectPicker *pDsObjectPicker,
STGMEDIUM stm;
FORMATETC fe;
fe.cfFormat = RegisterClipboardFormat(CFSTR_DSOP_DS_SELECTION_LIST);
fe.cfFormat = (CLIPFORMAT) RegisterClipboardFormat(CFSTR_DSOP_DS_SELECTION_LIST);
fe.ptd = NULL;
fe.dwAspect = DVASPECT_CONTENT;
fe.lindex = -1;
@ -787,6 +792,9 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
LONG lRet;
int item;
UNREFERENCED_PARAMETER(lParam);
UNREFERENCED_PARAMETER(message);
switch (LOWORD(wParam)) {
case ID_REGISTRY_IMPORTREGISTRYFILE:
ImportRegistryFile(hWnd);

View file

@ -182,7 +182,7 @@ HEXEDIT_PaintLines(PHEXEDIT_DATA hed, HDC hDC, DWORD ScrollPos, DWORD First, DWO
DWORD dx, dy, linestart;
INT x;
PBYTE buf, current, end, line;
UINT bufsize;
size_t bufsize;
TCHAR hex[3], addr[17];
RECT rct;
@ -526,6 +526,7 @@ HEXEDIT_WM_NCDESTROY(PHEXEDIT_DATA hed)
static LRESULT
HEXEDIT_WM_CREATE(PHEXEDIT_DATA hed)
{
UNREFERENCED_PARAMETER(hed);
return 1;
}
@ -541,6 +542,7 @@ HEXEDIT_WM_SETFOCUS(PHEXEDIT_DATA hed)
static LRESULT
HEXEDIT_WM_KILLFOCUS(PHEXEDIT_DATA hed)
{
UNREFERENCED_PARAMETER(hed);
DestroyCaret();
return 0;
}
@ -551,6 +553,8 @@ HEXEDIT_WM_VSCROLL(PHEXEDIT_DATA hed, WORD ThumbPosition, WORD SbCmd)
int ScrollY;
SCROLLINFO si;
UNREFERENCED_PARAMETER(ThumbPosition);
ZeroMemory(&si, sizeof(SCROLLINFO));
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_ALL;
@ -708,6 +712,9 @@ HEXEDIT_WM_MOUSEWHEEL(PHEXEDIT_DATA hed, int cyMoveLines, WORD ButtonsDown, LPPO
SCROLLINFO si;
int ScrollY;
UNREFERENCED_PARAMETER(ButtonsDown);
UNREFERENCED_PARAMETER(MousePos);
SetFocus(hed->hWndSelf);
si.cbSize = sizeof(SCROLLINFO);
@ -733,6 +740,7 @@ HEXEDIT_WM_MOUSEWHEEL(PHEXEDIT_DATA hed, int cyMoveLines, WORD ButtonsDown, LPPO
static LRESULT
HEXEDIT_WM_GETDLGCODE(LPMSG Msg)
{
UNREFERENCED_PARAMETER(Msg);
return DLGC_WANTARROWS | DLGC_WANTCHARS;
}
@ -743,6 +751,7 @@ HEXEDIT_WM_LBUTTONDOWN(PHEXEDIT_DATA hed, INT Buttons, POINTS Pt)
POINT EditPos;
DWORD Hit = HEXEDIT_HitRegionTest(hed, Pt);
UNREFERENCED_PARAMETER(Buttons);
SetFocus(hed->hWndSelf);
hed->Position = HEXEDIT_PositionFromPoint(hed, Pt, Hit, &EditPos, &NewField);
@ -849,6 +858,9 @@ HEXEDIT_WM_KEYDOWN(PHEXEDIT_DATA hed, INT VkCode)
static LRESULT
HEXEDIT_WM_SIZE(PHEXEDIT_DATA hed, DWORD sType, WORD NewWidth, WORD NewHeight)
{
UNREFERENCED_PARAMETER(sType);
UNREFERENCED_PARAMETER(NewHeight);
UNREFERENCED_PARAMETER(NewWidth);
HEXEDIT_Update(hed);
return 0;
}

View file

@ -128,7 +128,7 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, void* ValB
item.state = 0;
item.stateMask = 0;
item.pszText = Name;
item.cchTextMax = _tcslen(item.pszText);
item.cchTextMax = (int) _tcslen(item.pszText);
if (item.cchTextMax == 0)
item.pszText = LPSTR_TEXTCALLBACK;
item.iImage = 0;
@ -356,6 +356,8 @@ static void OnGetDispInfo(NMLVDISPINFO* plvdi)
static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
LINE_INFO*l, *r;
UNREFERENCED_PARAMETER(lParamSort);
l = (LINE_INFO*)lParam1;
r = (LINE_INFO*)lParam2;
@ -373,6 +375,7 @@ static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSor
BOOL ListWndNotifyProc(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL *Result)
{
NMLVDISPINFO* Info;
UNREFERENCED_PARAMETER(wParam);
*Result = TRUE;
switch (((LPNMHDR)lParam)->code) {
case LVN_GETDISPINFO:

View file

@ -62,41 +62,38 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
HMENU hEditMenu;
TCHAR szBuffer[256];
WNDCLASSEX wcFrame = {
sizeof(WNDCLASSEX),
CS_HREDRAW | CS_VREDRAW/*style*/,
FrameWndProc,
0/*cbClsExtra*/,
0/*cbWndExtra*/,
hInstance,
LoadIcon(hInstance, MAKEINTRESOURCE(IDI_REGEDIT)),
LoadCursor(0, IDC_ARROW),
0/*hbrBackground*/,
0/*lpszMenuName*/,
szFrameClass,
(HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_REGEDIT), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED)
};
ATOM hFrameWndClass = RegisterClassEx(&wcFrame); /* register frame window class */
WNDCLASSEX wcFrame;
WNDCLASSEX wcChild;
ATOM hFrameWndClass;
ATOM hChildWndClass;
WNDCLASSEX wcChild = {
sizeof(WNDCLASSEX),
CS_HREDRAW | CS_VREDRAW/*style*/,
ChildWndProc,
0/*cbClsExtra*/,
sizeof(HANDLE)/*cbWndExtra*/,
hInstance,
LoadIcon(hInstance, MAKEINTRESOURCE(IDI_REGEDIT)),
LoadCursor(0, IDC_ARROW),
0/*hbrBackground*/,
0/*lpszMenuName*/,
szChildClass,
(HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_REGEDIT), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED)
ZeroMemory(&wcFrame, sizeof(WNDCLASSEX));
wcFrame.cbSize = sizeof(WNDCLASSEX);
wcFrame.style = CS_HREDRAW | CS_VREDRAW;
wcFrame.lpfnWndProc = FrameWndProc;
wcFrame.hInstance = hInstance;
wcFrame.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_REGEDIT));
wcFrame.hIconSm = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_REGEDIT),
IMAGE_ICON, GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON), LR_SHARED);
wcFrame.hCursor = LoadCursor(0, IDC_ARROW);
wcFrame.lpszClassName = szFrameClass;
};
ATOM hChildWndClass = RegisterClassEx(&wcChild); /* register child windows class */
hChildWndClass = hChildWndClass; /* warning eater */
hFrameWndClass = RegisterClassEx(&wcFrame); /* register frame window class */
ZeroMemory(&wcChild, sizeof(WNDCLASSEX));
wcChild.cbSize = sizeof(WNDCLASSEX);
wcChild.style = CS_HREDRAW | CS_VREDRAW;
wcChild.lpfnWndProc = ChildWndProc;
wcChild.cbWndExtra = sizeof(HANDLE);
wcChild.hInstance = hInstance;
wcChild.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_REGEDIT));
wcChild.hCursor = LoadCursor(0, IDC_ARROW),
wcChild.lpszClassName = szChildClass,
wcChild.hIconSm = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_REGEDIT), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED);
hChildWndClass = RegisterClassEx(&wcChild); /* register child windows class */
RegisterHexEditorClass(hInstance);
@ -195,6 +192,8 @@ int APIENTRY WinMain(HINSTANCE hInstance,
MSG msg;
HACCEL hAccel;
UNREFERENCED_PARAMETER(hPrevInstance);
/*
int hCrt;
FILE *hf;
@ -238,5 +237,5 @@ int APIENTRY WinMain(HINSTANCE hInstance,
}
ExitInstance(hInstance);
return msg.wParam;
return (int) msg.wParam;
}

View file

@ -227,8 +227,8 @@ DWORD convertHexCSVToHex(char *str, BYTE *buf, ULONG bufLen)
char *s = str; /* Pointer to current */
char *b = (char*) buf; /* Pointer to result */
ULONG strLen = strlen(str);
ULONG strPos = 0;
size_t strLen = strlen(str);
size_t strPos = 0;
DWORD byteCount = 0;
memset(buf, 0, bufLen);
@ -645,6 +645,7 @@ void doQueryValue(LPSTR stdInput)
*/
void doDeleteValue(LPSTR line)
{
UNREFERENCED_PARAMETER(line);
fprintf(stderr,"%s: deleteValue not yet implemented\n", getAppName());
}
@ -655,6 +656,7 @@ void doDeleteValue(LPSTR line)
*/
void doDeleteKey(LPSTR line)
{
UNREFERENCED_PARAMETER(line);
fprintf(stderr,"%s: deleteKey not yet implemented\n", getAppName());
}
@ -665,6 +667,7 @@ void doDeleteKey(LPSTR line)
*/
void doCreateKey(LPSTR line)
{
UNREFERENCED_PARAMETER(line);
fprintf(stderr,"%s: createKey not yet implemented\n", getAppName());
}
@ -735,6 +738,7 @@ void processSetValue(LPSTR line)
*/
void processQueryValue(LPSTR cmdline)
{
UNREFERENCED_PARAMETER(cmdline);
fprintf(stderr,"ERROR!!! - temporary disabled");
exit(1);
#if 0
@ -1791,6 +1795,8 @@ LONG RegSearch(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength,
LONG lResult;
LPCTSTR s;
UNREFERENCED_PARAMETER(dwValueIndex);
if (dwSearchFlags & (RSF_LOOKATVALUES | RSF_LOOKATDATA))
return ERROR_CALL_NOT_IMPLEMENTED; /* NYI */

View file

@ -28,6 +28,8 @@ DEFINE_GUID(IID_IRegKeySecurity, 0x965fc360, 0x16ff, 0x11d0, 0x0091, 0xcb,0x00,0
#if REGEDIT_IMPLEMENT_ISECURITYINFORMATION2
DEFINE_GUID(IID_IRegKeySecurity2, 0xc3ccfdb4, 0x6f88, 0x11d2, 0x00a3, 0xce,0x00,0xc0,0x4f,0xb1,0x78,0x2a);
#endif
/* FIXME: already defined in aclui.h - causing problems when compiling with MSVC/PSDK*/
DEFINE_GUID(IID_IEffectivePermission, 0x3853dc76, 0x9f35, 0x407c, 0x0088, 0xa1,0xd1,0x93,0x44,0x36,0x5f,0xbc);
DEFINE_GUID(IID_ISecurityObjectTypeInfo, 0xfc3066eb, 0x79ef, 0x444b, 0x0091, 0x11,0xd1,0x8a,0x75,0xeb,0xf2,0xfa);
@ -839,7 +841,7 @@ RegKeyEditPermissions(HWND hWndOwner,
LPTSTR lpKeyPath = NULL;
PCRegKeySecurity RegKeySecurity;
SI_OBJECT_INFO ObjectInfo;
int lnMachine = 0, lnKeyName = 0;
size_t lnMachine = 0, lnKeyName = 0;
if (pfnEditSecurity == NULL)
{