forked from Baron-von-Riedesel/ExplASM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCOleInPlaceFrame.asm
More file actions
210 lines (147 loc) · 5.01 KB
/
COleInPlaceFrame.asm
File metadata and controls
210 lines (147 loc) · 5.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
.386
.model flat, stdcall
option casemap:none
option proc:private
.nolist
.nocref
WIN32_LEAN_AND_MEAN equ 1
INCL_OLE2 equ 1
_WIN32_IE equ 500h
include windows.inc
include commctrl.inc
include windowsx.inc
include shellapi.inc
include objidl.inc
include olectl.inc
include shlguid.inc
include shlobj.inc
include shlwapi.inc
include shobjidl.inc
include macros.inc
LPDROPTARGETHELPER typedef ptr IDropTargetHelper
?AGGREGATION = 0 ;no aggregation
?EVENTSUPPORT = 0 ;no event support
include olecntrl.inc
include debugout.inc
include rsrc.inc
.list
.cref
;protostrlenW typedef proto :ptr WORD
;externdef _imp__lstrlenW@4:PTR protostrlenW
;lstrlenW equ <_imp__lstrlenW@4>
INSIDE_CShellBrowser equ 1
include CShellBrowser.inc
if ?OLEINPLACEFRAME
E_NOTOOLSPACE equ 800401A1h
.const
COleInPlaceFrameVtbl label DWORD
IUnknownVtbl {QueryInterface_, AddRef_, Release_}
dd offset GetWindow__
dd offset ContextSensitiveHelp_
dd offset GetBorder_
dd offset RequestBorderSpace_
dd offset SetBorderSpace_
dd offset SetActiveObject_
dd offset InsertMenus_
dd offset SetMenu__
dd offset RemoveMenus_
dd offset SetStatusText_
dd offset EnableModeless_
dd offset TranslateAccelerator__
.code
__this textequ <ebx>
_this textequ <[__this].CShellBrowser>
MEMBER hWnd, pOleInPlaceActiveObject
@MakeStubsEx CShellBrowser, IOleInPlaceFrame, QueryInterface, AddRef, Release
@MakeStubs CShellBrowser, IOleInPlaceFrame, GetWindow_, ContextSensitiveHelp
@MakeStubs CShellBrowser, IOleInPlaceFrame, GetBorder, RequestBorderSpace
@MakeStubs CShellBrowser, IOleInPlaceFrame, SetBorderSpace, SetActiveObject
@MakeStubs CShellBrowser, IOleInPlaceFrame, InsertMenus, SetMenu_, RemoveMenus
@MakeStubs CShellBrowser, IOleInPlaceFrame, SetStatusText, EnableModeless, TranslateAccelerator_
GetWindow_ proc uses __this this_:ptr CShellBrowser, phwnd:ptr HWND
DebugOut "IOleInPlaceSite::GetWindow"
mov __this, this_
mov eax, phwnd
mov ecx, m_hWnd
mov [eax], ecx
return S_OK
GetWindow_ endp
ContextSensitiveHelp proc this_:ptr CShellBrowser, fEnterMode:BYTE
DebugOut "IOleInPlaceSite::ContextSensitiveHelp"
return E_NOTIMPL
ContextSensitiveHelp endp
GetBorder proc uses __this this_:ptr CShellBrowser, lprectBorder:ptr RECT
DebugOut "IOleInPlaceUIWindow::GetBorder"
return E_NOTOOLSPACE
GetBorder endp
RequestBorderSpace proc this_:ptr CShellBrowser, pborderwidths:ptr BORDERWIDTHS
DebugOut "IOleInPlaceUIWindow::RequestBorderSpace"
return E_NOTOOLSPACE
RequestBorderSpace endp
SetBorderSpace proc uses __this esi this_:ptr CShellBrowser, pborderwidths:ptr BORDERWIDTHS
DebugOut "IOleInPlaceUIWindow::SetBorderSpace(%X)", pborderwidths
mov eax,pborderwidths
.if (!eax)
return S_OK
.else
mov ecx,[eax].BORDERWIDTHS.left
add ecx,[eax].BORDERWIDTHS.top
add ecx,[eax].BORDERWIDTHS.right
add ecx,[eax].BORDERWIDTHS.bottom
.if (!ecx)
return S_OK
.endif
.endif
return E_UNEXPECTED
SetBorderSpace endp
SetActiveObject proc uses __this this_:ptr CShellBrowser, pActiveObject:LPOLEINPLACEACTIVEOBJECT, pszObjName:ptr WORD
DebugOut "IOleInPlaceUIWindow::SetActiveObject(%X)", pActiveObject
mov __this,this_
.if (m_pOleInPlaceActiveObject)
invoke vf(m_pOleInPlaceActiveObject, IOleInPlaceActiveObject, Release)
.endif
mov eax, pActiveObject
mov m_pOleInPlaceActiveObject, eax
.if (m_pOleInPlaceActiveObject)
invoke vf(m_pOleInPlaceActiveObject, IOleInPlaceActiveObject, AddRef)
.endif
return S_OK
SetActiveObject endp
InsertMenus proc uses esi this_:ptr CShellBrowser, hmenuShared:HMENU, lpMenuWidths:ptr OLEMENUGROUPWIDTHS
DebugOut "IOleInPlaceFrame::InsertMenus(%X)", hmenuShared
return E_UNEXPECTED
InsertMenus endp
SetMenu_ proc uses __this this_:ptr CShellBrowser, hmenuShared:HMENU, holemenu:HANDLE, hwndActiveObject:HWND
DebugOut "IOleInPlaceFrame::SetMenu(%X, %X, %X)", hmenuShared, holemenu, hwndActiveObject
return E_UNEXPECTED
SetMenu_ endp
RemoveMenus proc uses __this this_:ptr CShellBrowser, hmenuShared:HMENU
DebugOut "IOleInPlaceFrame::RemoveMenus(%X)", hmenuShared
return E_UNEXPECTED
RemoveMenus endp
SetStatusText proc uses __this this_:ptr CShellBrowser, pszStatusText:ptr WORD
local dwSize:DWORD
mov __this,this_
.if (pszStatusText)
invoke lstrlenW, pszStatusText
add eax, 4
and al, 0FCh
sub esp, eax
mov dwSize, eax
mov edx, esp
invoke WideCharToMultiByte, CP_ACP, 0, pszStatusText, -1, edx, dwSize, NULL, NULL
;; invoke SetStatusText@CViewObjectDlg, m_pViewObjectDlg, 0, esp
add esp, dwSize
.endif
return S_OK
SetStatusText endp
EnableModeless proc this_:ptr CShellBrowser, fEnable:DWORD
DebugOut "IOleInPlaceFrame::EnableModeless(%u)", fEnable
return S_OK
EnableModeless endp
TranslateAccelerator_ proc this_:ptr CShellBrowser, lpmsg:ptr MSG, wID:WORD
DebugOut "IOleInPlaceFrame::TranslateAccelerator"
return S_FALSE
TranslateAccelerator_ endp
endif
end