Hi José,
I finally decided to try to resolve a compile warning that has been happening ever since I switched to using the new WinFBE HTML based help system.
You can see the warning in the attached screenshot.
This warning appears when compiling the 64-bit version of WinFBE.
Looks like it is this line where the warning occurs. SID_SInPlaceBrowser is 16 bytes, but guidService is a GUID ptr (8 bytes on 64 byte Windows).
IF IsEqualIID(@guidService, @SID_SInPlaceBrowser) THEN
' ========================================================================================
' Acts as the factory method for any services exposed through an implementation of
' IServiceProvider.
' ========================================================================================
FUNCTION CAxHost_IServiceProvider.QueryService (BYVAL guidService AS const GUID const PTR, BYVAL riid AS const IID const PTR, BYVAL ppvObject AS ANY PTR PTR) AS HRESULT
DIM pwsz AS WSTRING PTR
StringFromIID(guidService, CAST(LPOLESTR PTR, @pwsz))
DIM s AS STRING : IF pwsz THEN s = *pwsz : CoTaskMemFree(pwsz)
StringFromIID(riid, CAST(LPOLESTR PTR, @pwsz))
DIM s2 AS STRING : IF pwsz THEN s2 = *pwsz : CoTaskMemFree(pwsz)
' CAXH_DP("CAxHost_IServiceProvider QueryService SID = " & s & " - IID = " & s2)
CAXH_DP("QueryService SID = " & s)
CAXH_DP("QueryService IID = " & s2)
' // Handle SID_SInPlaceBrowser (needed to enable the filesystem object to navigate
' // in-place within the WebBrowser control when running on Windows 7+)
IF IsEqualIID(@guidService, @SID_SInPlaceBrowser) THEN
RETURN AfxAxHostQueryService(CAST(IUnknown PTR, m_pAxHost->m_pOcx), @SID_SShellBrowser, riid, @ppvObject)
END IF
RETURN E_NOINTERFACE
END FUNCTION
' ========================================================================================
Here is the generated "C" code:
int32 _ZN3AFX24CAXHOST_ISERVICEPROVIDER12QUERYSERVICEEPK5_GUIDS4_PPv( struct $N3AFX24CAXHOST_ISERVICEPROVIDERE* THIS$1, struct $5_GUID* GUIDSERVICE$1, struct $5_GUID* RIID$1, void** PPVOBJECT$1 )
{
int32 fb$result$1;
__builtin_memset( &fb$result$1, 0, 4ll );
label$9536:;
uint16* PWSZ$1;
__builtin_memset( &PWSZ$1, 0, 8ll );
StringFromIID( GUIDSERVICE$1, &PWSZ$1 );
FBSTRING S$1;
__builtin_memset( &S$1, 0, 24ll );
if( PWSZ$1 == (uint16*)0ull ) goto label$9539;
{
fb_WstrAssignToA( (void*)&S$1, -1ll, (uint16*)PWSZ$1, 0 );
CoTaskMemFree( (void*)PWSZ$1 );
label$9539:;
}
StringFromIID( RIID$1, &PWSZ$1 );
FBSTRING S2$1;
__builtin_memset( &S2$1, 0, 24ll );
if( PWSZ$1 == (uint16*)0ull ) goto label$9541;
{
fb_WstrAssignToA( (void*)&S2$1, -1ll, (uint16*)PWSZ$1, 0 );
CoTaskMemFree( (void*)PWSZ$1 );
label$9541:;
}
int32 vr$9 = memcmp( (void*)&GUIDSERVICE$1, (void*)&SID_SInPlaceBrowser, 16ull );
if( (int64)vr$9 != 0ll ) goto label$9543;
{
int32 vr$14 = _ZN3AFX21AFXAXHOSTQUERYSERVICEEP9IUnknown_PK5_GUIDS5_PPv( *(struct $9IUnknown_**)((uint8*)*(struct $N3AFX7CAXHOSTE**)((uint8*)THIS$1 + 16ll) + 16ll), (struct $5_GUID*)&IID_IShellBrowser, RIID$1, (void**)&PPVOBJECT$1 );
fb$result$1 = vr$14;
fb_StrDelete( (FBSTRING*)&S2$1 );
fb_StrDelete( (FBSTRING*)&S$1 );
goto label$9537;
}
label$9543:;
label$9542:;
fb$result$1 = -2147467262;
fb_StrDelete( (FBSTRING*)&S2$1 );
fb_StrDelete( (FBSTRING*)&S$1 );
goto label$9537;
fb_StrDelete( (FBSTRING*)&S2$1 );
fb_StrDelete( (FBSTRING*)&S$1 );
label$9537:;
return fb$result$1;
}
I wanted to bring it to your attention because I am afraid that if I start hacking away at the issue then I may screw up other areas of your CAxHost code.
I'm still using 1.07 and does not give any warning.
If guidService is already a GUID PTR, then it should be
IF IsEqualIID(guidService, @SID_SInPlaceBrowser) THEN
instead of
IF IsEqualIID(@guidService, @SID_SInPlaceBrowser) THEN
otherwise it will point to the address of the pointer instead of the address of the GUID.
Thanks José, yes that makes sense. guidService is already a pointer so I changed your code to use that value rather than the address of the pointer itself.
Everything compiles perfectly now without any warnings.