oleview: Switch the rest to use the explicit W-types/functions.

Compile with -DWINE_NO_UNICODE_MACROS.
This commit is contained in:
Michael Stefaniuc 2010-05-07 10:46:52 +02:00 committed by Alexandre Julliard
parent 12be9c39f2
commit c34c6ac20e
4 changed files with 35 additions and 35 deletions

View File

@ -5,7 +5,7 @@ VPATH = @srcdir@
MODULE = oleview.exe MODULE = oleview.exe
APPMODE = -mwindows APPMODE = -mwindows
IMPORTS = uuid comdlg32 comctl32 shell32 oleaut32 ole32 user32 advapi32 kernel32 IMPORTS = uuid comdlg32 comctl32 shell32 oleaut32 ole32 user32 advapi32 kernel32
EXTRADEFS = -DUNICODE EXTRADEFS = -DWINE_NO_UNICODE_MACROS
C_SRCS = \ C_SRCS = \
details.c \ details.c \

View File

@ -28,12 +28,12 @@ typedef struct
BOOL IsInterface(HTREEITEM item) BOOL IsInterface(HTREEITEM item)
{ {
TVITEM tvi; TVITEMW tvi;
memset(&tvi, 0, sizeof(TVITEM)); memset(&tvi, 0, sizeof(TVITEMW));
tvi.hItem = item; tvi.hItem = item;
SendMessage(globals.hTree, TVM_GETITEM, 0, (LPARAM)&tvi); SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
if(!tvi.lParam) return FALSE; if(!tvi.lParam) return FALSE;
if(((ITEM_INFO*)tvi.lParam)->cFlag & INTERFACE) return TRUE; if(((ITEM_INFO*)tvi.lParam)->cFlag & INTERFACE) return TRUE;
@ -43,22 +43,22 @@ BOOL IsInterface(HTREEITEM item)
static IUnknown *GetInterface(void) static IUnknown *GetInterface(void)
{ {
HTREEITEM hSelect; HTREEITEM hSelect;
TVITEM tvi; TVITEMW tvi;
CLSID clsid; CLSID clsid;
IUnknown *unk; IUnknown *unk;
hSelect = (HTREEITEM)SendMessageW(globals.hTree, TVM_GETNEXTITEM, hSelect = (HTREEITEM)SendMessageW(globals.hTree, TVM_GETNEXTITEM,
TVGN_CARET, 0); TVGN_CARET, 0);
memset(&tvi, 0, sizeof(TVITEM)); memset(&tvi, 0, sizeof(TVITEMW));
tvi.hItem = hSelect; tvi.hItem = hSelect;
SendMessage(globals.hTree, TVM_GETITEM, 0, (LPARAM)&tvi); SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
CLSIDFromString(((ITEM_INFO *)tvi.lParam)->clsid, &clsid); CLSIDFromString(((ITEM_INFO *)tvi.lParam)->clsid, &clsid);
memset(&tvi, 0, sizeof(TVITEM)); memset(&tvi, 0, sizeof(TVITEMW));
tvi.hItem = (HTREEITEM)SendMessageW(globals.hTree, TVM_GETNEXTITEM, tvi.hItem = (HTREEITEM)SendMessageW(globals.hTree, TVM_GETNEXTITEM,
TVGN_PARENT, (LPARAM)hSelect); TVGN_PARENT, (LPARAM)hSelect);
SendMessage(globals.hTree, TVM_GETITEM, 0, (LPARAM)&tvi); SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
IUnknown_QueryInterface(((ITEM_INFO *)tvi.lParam)->pU, &clsid, (void *)&unk); IUnknown_QueryInterface(((ITEM_INFO *)tvi.lParam)->pU, &clsid, (void *)&unk);
@ -82,9 +82,9 @@ static INT_PTR CALLBACK InterfaceViewerProc(HWND hDlgWnd, UINT uMsg,
case WM_INITDIALOG: case WM_INITDIALOG:
di = (DIALOG_INFO *)lParam; di = (DIALOG_INFO *)lParam;
hObject = GetDlgItem(hDlgWnd, IDC_LABEL); hObject = GetDlgItem(hDlgWnd, IDC_LABEL);
SetWindowText(hObject, di->wszLabel); SetWindowTextW(hObject, di->wszLabel);
hObject = GetDlgItem(hDlgWnd, IDC_IDENTIFIER); hObject = GetDlgItem(hDlgWnd, IDC_IDENTIFIER);
SetWindowText(hObject, di->wszIdentifier); SetWindowTextW(hObject, di->wszIdentifier);
return TRUE; return TRUE;
case WM_COMMAND: case WM_COMMAND:
switch(LOWORD(wParam)) { switch(LOWORD(wParam)) {
@ -96,22 +96,22 @@ static INT_PTR CALLBACK InterfaceViewerProc(HWND hDlgWnd, UINT uMsg,
hRes = IPersistStream_IsDirty((IPersistStream *)unk); hRes = IPersistStream_IsDirty((IPersistStream *)unk);
IUnknown_Release(unk); IUnknown_Release(unk);
if(hRes == S_OK) if(hRes == S_OK)
LoadString(globals.hMainInst, IDS_FALSE, wszBuf, LoadStringW(globals.hMainInst, IDS_FALSE, wszBuf,
sizeof(wszBuf)/sizeof(wszBuf[0])); sizeof(wszBuf)/sizeof(wszBuf[0]));
else LoadString(globals.hMainInst, IDS_TRUE, wszBuf, else LoadStringW(globals.hMainInst, IDS_TRUE, wszBuf,
sizeof(wszBuf)/sizeof(wszBuf[0])); sizeof(wszBuf)/sizeof(wszBuf[0]));
hObject = GetDlgItem(hDlgWnd, IDC_ISDIRTY); hObject = GetDlgItem(hDlgWnd, IDC_ISDIRTY);
SetWindowText(hObject, wszBuf); SetWindowTextW(hObject, wszBuf);
return TRUE; return TRUE;
case IDC_GETSIZEMAX_BUTTON: case IDC_GETSIZEMAX_BUTTON:
unk = GetInterface(); unk = GetInterface();
IPersistStream_GetSizeMax((IPersistStream *)unk, &size); IPersistStream_GetSizeMax((IPersistStream *)unk, &size);
IUnknown_Release(unk); IUnknown_Release(unk);
LoadString(globals.hMainInst, IDS_BYTES, wszBuf, LoadStringW(globals.hMainInst, IDS_BYTES, wszBuf,
sizeof(wszBuf)/sizeof(wszBuf[0])); sizeof(wszBuf)/sizeof(wszBuf[0]));
wsprintfW(wszSize, wszFormat, U(size).LowPart, wszBuf); wsprintfW(wszSize, wszFormat, U(size).LowPart, wszBuf);
hObject = GetDlgItem(hDlgWnd, IDC_GETSIZEMAX); hObject = GetDlgItem(hDlgWnd, IDC_GETSIZEMAX);
SetWindowText(hObject, wszSize); SetWindowTextW(hObject, wszSize);
return TRUE; return TRUE;
} }
} }
@ -128,7 +128,7 @@ static void IPersistStreamInterfaceViewer(WCHAR *clsid, WCHAR *wszName)
else di.wszLabel = wszName; else di.wszLabel = wszName;
di.wszIdentifier = clsid; di.wszIdentifier = clsid;
DialogBoxParam(0, MAKEINTRESOURCE(DLG_IPERSISTSTREAM_IV), DialogBoxParamW(0, MAKEINTRESOURCEW(DLG_IPERSISTSTREAM_IV),
globals.hMainWnd, InterfaceViewerProc, (LPARAM)&di); globals.hMainWnd, InterfaceViewerProc, (LPARAM)&di);
} }
@ -142,7 +142,7 @@ static void IPersistInterfaceViewer(WCHAR *clsid, WCHAR *wszName)
else di.wszLabel = wszName; else di.wszLabel = wszName;
di.wszIdentifier = clsid; di.wszIdentifier = clsid;
DialogBoxParam(0, MAKEINTRESOURCE(DLG_IPERSIST_IV), DialogBoxParamW(0, MAKEINTRESOURCEW(DLG_IPERSIST_IV),
globals.hMainWnd, InterfaceViewerProc, (LPARAM)&di); globals.hMainWnd, InterfaceViewerProc, (LPARAM)&di);
} }
@ -153,13 +153,13 @@ static void DefaultInterfaceViewer(WCHAR *clsid, WCHAR *wszName)
di.wszLabel = wszName; di.wszLabel = wszName;
di.wszIdentifier = clsid; di.wszIdentifier = clsid;
DialogBoxParam(0, MAKEINTRESOURCE(DLG_DEFAULT_IV), DialogBoxParamW(0, MAKEINTRESOURCEW(DLG_DEFAULT_IV),
globals.hMainWnd, InterfaceViewerProc, (LPARAM)&di); globals.hMainWnd, InterfaceViewerProc, (LPARAM)&di);
} }
void InterfaceViewer(HTREEITEM item) void InterfaceViewer(HTREEITEM item)
{ {
TVITEM tvi; TVITEMW tvi;
WCHAR *clsid; WCHAR *clsid;
WCHAR wszName[MAX_LOAD_STRING]; WCHAR wszName[MAX_LOAD_STRING];
WCHAR wszParent[MAX_LOAD_STRING]; WCHAR wszParent[MAX_LOAD_STRING];
@ -170,23 +170,23 @@ void InterfaceViewer(HTREEITEM item)
'0','0','0','0','-','0','0','0','0','-','C','0','0','0','-', '0','0','0','0','-','0','0','0','0','-','C','0','0','0','-',
'0','0','0','0','0','0','0','0','0','0','4','6','}','\0' }; '0','0','0','0','0','0','0','0','0','0','4','6','}','\0' };
memset(&tvi, 0, sizeof(TVITEM)); memset(&tvi, 0, sizeof(TVITEMW));
tvi.mask = TVIF_TEXT; tvi.mask = TVIF_TEXT;
tvi.hItem = item; tvi.hItem = item;
tvi.cchTextMax = MAX_LOAD_STRING; tvi.cchTextMax = MAX_LOAD_STRING;
tvi.pszText = wszName; tvi.pszText = wszName;
SendMessage(globals.hTree, TVM_GETITEM, 0, (LPARAM)&tvi); SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
clsid = ((ITEM_INFO*)tvi.lParam)->clsid; clsid = ((ITEM_INFO*)tvi.lParam)->clsid;
memset(&tvi, 0, sizeof(TVITEM)); memset(&tvi, 0, sizeof(TVITEMW));
tvi.mask = TVIF_TEXT; tvi.mask = TVIF_TEXT;
tvi.hItem = (HTREEITEM)SendMessageW(globals.hTree, TVM_GETNEXTITEM, tvi.hItem = (HTREEITEM)SendMessageW(globals.hTree, TVM_GETNEXTITEM,
TVGN_PARENT, (LPARAM)item); TVGN_PARENT, (LPARAM)item);
tvi.cchTextMax = MAX_LOAD_STRING; tvi.cchTextMax = MAX_LOAD_STRING;
tvi.pszText = wszParent; tvi.pszText = wszParent;
SendMessage(globals.hTree, TVM_GETITEM, 0, (LPARAM)&tvi); SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
if(!memcmp(clsid, wszIPersistStream, sizeof(wszIPersistStream))) if(!memcmp(clsid, wszIPersistStream, sizeof(wszIPersistStream)))
IPersistStreamInterfaceViewer(clsid, wszParent); IPersistStreamInterfaceViewer(clsid, wszParent);

View File

@ -138,7 +138,7 @@ void RefreshMenu(HTREEITEM item);
/* pane.c */ /* pane.c */
BOOL CreatePanedWindow(HWND hWnd, HWND *hWndCreated, HINSTANCE hInst); BOOL CreatePanedWindow(HWND hWnd, HWND *hWndCreated, HINSTANCE hInst);
BOOL PaneRegisterClass(void); BOOL PaneRegisterClassW(void);
void SetLeft(HWND hParent, HWND hWnd); void SetLeft(HWND hParent, HWND hWnd);
void SetRight(HWND hParent, HWND hWnd); void SetRight(HWND hParent, HWND hWnd);
@ -153,7 +153,7 @@ void ReleaseInst(HTREEITEM item);
/* typelib.c */ /* typelib.c */
BOOL CreateTypeLibWindow(HINSTANCE hInst, WCHAR *wszFileName); BOOL CreateTypeLibWindow(HINSTANCE hInst, WCHAR *wszFileName);
BOOL TypeLibRegisterClass(void); BOOL TypeLibRegisterClassW(void);
void UpdateData(HTREEITEM item); void UpdateData(HTREEITEM item);
/* interface.c */ /* interface.c */

View File

@ -70,7 +70,7 @@ static LRESULT CALLBACK PaneProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if(pt.x >= GetSplitPos(hWnd)-pane->size/2 && if(pt.x >= GetSplitPos(hWnd)-pane->size/2 &&
pt.x <= GetSplitPos(hWnd)+pane->size/2) pt.x <= GetSplitPos(hWnd)+pane->size/2)
SetCursor(LoadCursor(0, IDC_SIZEWE)); SetCursor(LoadCursorW(0, (LPWSTR)IDC_SIZEWE));
break; break;
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
if((short)LOWORD(lParam) >= GetSplitPos(hWnd)-pane->size/2 && if((short)LOWORD(lParam) >= GetSplitPos(hWnd)-pane->size/2 &&
@ -103,8 +103,8 @@ static LRESULT CALLBACK PaneProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if((int)wParam != TYPELIB_TREE) break; if((int)wParam != TYPELIB_TREE) break;
switch(((LPNMHDR)lParam)->code) switch(((LPNMHDR)lParam)->code)
{ {
case TVN_SELCHANGED: case TVN_SELCHANGEDW:
UpdateData(((NMTREEVIEW *)lParam)->itemNew.hItem); UpdateData(((NMTREEVIEWW *)lParam)->itemNew.hItem);
break; break;
} }
break; break;
@ -123,22 +123,22 @@ static LRESULT CALLBACK PaneProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa
HeapFree(GetProcessHeap(), 0, pane); HeapFree(GetProcessHeap(), 0, pane);
break; break;
default: default:
return DefWindowProc(hWnd, uMsg, wParam, lParam); return DefWindowProcW(hWnd, uMsg, wParam, lParam);
} }
return 0; return 0;
} }
BOOL PaneRegisterClass(void) BOOL PaneRegisterClassW(void)
{ {
WNDCLASS wcc; WNDCLASSW wcc;
const WCHAR wszPaneClass[] = { 'P','A','N','E','\0' }; const WCHAR wszPaneClass[] = { 'P','A','N','E','\0' };
memset(&wcc, 0, sizeof(WNDCLASS)); memset(&wcc, 0, sizeof(WNDCLASSW));
wcc.lpfnWndProc = PaneProc; wcc.lpfnWndProc = PaneProc;
wcc.hbrBackground = (HBRUSH)(COLOR_WINDOW); wcc.hbrBackground = (HBRUSH)(COLOR_WINDOW);
wcc.lpszClassName = wszPaneClass; wcc.lpszClassName = wszPaneClass;
if(!RegisterClass(&wcc)) if(!RegisterClassW(&wcc))
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
@ -149,7 +149,7 @@ BOOL CreatePanedWindow(HWND hWnd, HWND *hWndCreated, HINSTANCE hInst)
PANE *pane; PANE *pane;
pane = HeapAlloc(GetProcessHeap(), 0, sizeof(PANE)); pane = HeapAlloc(GetProcessHeap(), 0, sizeof(PANE));
*hWndCreated = CreateWindow(wszPaneClass, NULL, WS_CHILD|WS_VISIBLE, *hWndCreated = CreateWindowW(wszPaneClass, NULL, WS_CHILD|WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, hWnd, (HMENU)pane, hInst, NULL); CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, hWnd, (HMENU)pane, hInst, NULL);
if(!*hWndCreated) if(!*hWndCreated)
{ {