Decompile 2 functions in Source/Client/Browser/BrowserSiteAttachment.cpp
Batch #14559 by Yommy: 2 byte-identical, 0 confirmed by peer review. - fn_45431 CWebBrowser::DetachSite: byte-identical - fn_17417 CWebBrowser::AttachSite: byte-identical Merged automatically: every function is byte-identical to the original.
This commit is contained in:
parent
181bab8dcb
commit
70b8dbbc85
1 changed files with 33 additions and 15 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#include "Client/Browser/WebBrowser.h"
|
||||
|
||||
#include <new>
|
||||
#include <ocidl.h>
|
||||
|
||||
// OFFSET: 0x00AB2AB0
|
||||
// FUNCTION: fn_17417
|
||||
|
|
@ -9,25 +10,34 @@ bool CWebBrowser::AttachSite() {
|
|||
this->site = new BrowserClientSite(this->host, this->browser);
|
||||
IOleObject* object;
|
||||
HRESULT result = this->browser->QueryInterface(IID_IOleObject, reinterpret_cast<void**>(&object));
|
||||
if (FAILED(result)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
result = object->SetClientSite(this->site);
|
||||
if (SUCCEEDED(result)) {
|
||||
OleSetContainedObject(object, TRUE);
|
||||
RECT rectangle;
|
||||
GetClientRect(this->host, &rectangle);
|
||||
result = object->DoVerb(OLEIVERB_INPLACEACTIVATE, nullptr, this->site, 0, this->host, &rectangle);
|
||||
result = object->SetClientSite(this->site);
|
||||
if (SUCCEEDED(result)) {
|
||||
const int width = rectangle.right - rectangle.left;
|
||||
const int height = rectangle.bottom - rectangle.top;
|
||||
this->Resize(width, height);
|
||||
result = AdviseBrowserEvents(object, this->site, DIID_DWebBrowserEvents2, &this->cookie);
|
||||
OleSetContainedObject(object, TRUE);
|
||||
RECT rectangle;
|
||||
GetClientRect(this->host, &rectangle);
|
||||
result = object->DoVerb(OLEIVERB_INPLACEACTIVATE, nullptr, this->site, 0, this->host, &rectangle);
|
||||
if (SUCCEEDED(result)) {
|
||||
const int width = rectangle.right - rectangle.left;
|
||||
const int height = rectangle.bottom - rectangle.top;
|
||||
this->Resize(width, height);
|
||||
IConnectionPointContainer* container;
|
||||
result = object->QueryInterface(IID_IConnectionPointContainer, reinterpret_cast<void**>(&container));
|
||||
if (SUCCEEDED(result)) {
|
||||
IConnectionPoint* point;
|
||||
result = container->FindConnectionPoint(DIID_DWebBrowserEvents2, &point);
|
||||
if (SUCCEEDED(result)) {
|
||||
result = point->Advise(this->site, &this->cookie);
|
||||
point->Release();
|
||||
}
|
||||
container->Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object->Release();
|
||||
}
|
||||
|
||||
object->Release();
|
||||
return SUCCEEDED(result);
|
||||
}
|
||||
|
||||
|
|
@ -36,7 +46,15 @@ bool CWebBrowser::AttachSite() {
|
|||
void CWebBrowser::DetachSite() {
|
||||
IOleObject* object;
|
||||
if (SUCCEEDED(this->browser->QueryInterface(IID_IOleObject, reinterpret_cast<void**>(&object)))) {
|
||||
UnadviseBrowserEvents(object, DIID_DWebBrowserEvents2, this->cookie);
|
||||
IConnectionPointContainer* container;
|
||||
if (SUCCEEDED(object->QueryInterface(IID_IConnectionPointContainer, reinterpret_cast<void**>(&container)))) {
|
||||
IConnectionPoint* point;
|
||||
if (SUCCEEDED(container->FindConnectionPoint(DIID_DWebBrowserEvents2, &point))) {
|
||||
point->Unadvise(this->cookie);
|
||||
point->Release();
|
||||
}
|
||||
container->Release();
|
||||
}
|
||||
object->Release();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue