WebView2 日本語リファレンス
WebView2インターフェース › ICoreWebView2CustomSchemeRegistration

ICoreWebView2CustomSchemeRegistration

COM
IIDd60ac92c-37a6-4b26-a39e-95cfe59047bb継承元IUnknown自前メソッド開始 vtbl3

メソッド 7

vtbl = vtable インデックス(0始まり)。HSP等からインデックス指定でCOMメソッドを呼ぶ際に使用します。0〜2 は IUnknown。

vtbl 3 HRESULT get_SchemeName(LPWSTR* schemeName)
schemeNameLPWSTR*out登録するカスタムスキームの名前を受け取る LPWSTR へのポインタである。呼び出し側が CoTaskMemFree で解放する。
vtbl 4 HRESULT get_TreatAsSecure(BOOL* treatAsSecure)
treatAsSecureBOOL*outこのスキームを HTTPS と同様にセキュアとして扱うか否かを受け取る BOOL へのポインタである。
vtbl 5 HRESULT put_TreatAsSecure(BOOL value)
valueBOOLinこのスキームをセキュアとして扱うか否かを指定する BOOL である。
vtbl 6 HRESULT GetAllowedOrigins(DWORD* allowedOriginsCount, LPWSTR** allowedOrigins)
allowedOriginsCountDWORD*out返される許可オリジン配列の要素数を受け取る DWORD へのポインタである。
allowedOriginsLPWSTR**out許可オリジンの文字列配列を受け取る LPWSTR* の配列へのポインタである。呼び出し側が各要素および配列を解放する。
vtbl 7 HRESULT SetAllowedOrigins(DWORD allowedOriginsCount, LPWSTR* allowedOrigins)
allowedOriginsCountDWORDin設定する許可オリジン配列の要素数を指定する DWORD である。
allowedOriginsLPWSTR*inこのスキームへのアクセスを許可するオリジンの文字列配列(LPWSTR*)を指定する。
vtbl 8 HRESULT get_HasAuthorityComponent(BOOL* hasAuthorityComponent)
hasAuthorityComponentBOOL*outこのスキームの URI が authority(ホスト)コンポーネントを持つか否かを受け取る BOOL へのポインタである。
vtbl 9 HRESULT put_HasAuthorityComponent(BOOL hasAuthorityComponent)
hasAuthorityComponentBOOLinこのスキームの URI が authority コンポーネントを持つか否かを指定する BOOL である。

HSP用 COM定義

#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。WebView2 のインターフェースは環境/ローダ経由で取得するため #usecom 末尾は "{}"

出力引数:
#define global IID_ICoreWebView2CustomSchemeRegistration "{D60AC92C-37A6-4B26-A39E-95CFE59047BB}"
#usecom global ICoreWebView2CustomSchemeRegistration IID_ICoreWebView2CustomSchemeRegistration "{}"
#comfunc global ICoreWebView2CustomSchemeRegistration_get_SchemeName             3 var
#comfunc global ICoreWebView2CustomSchemeRegistration_get_TreatAsSecure          4 var
#comfunc global ICoreWebView2CustomSchemeRegistration_put_TreatAsSecure          5 int
#comfunc global ICoreWebView2CustomSchemeRegistration_GetAllowedOrigins          6 var,var
#comfunc global ICoreWebView2CustomSchemeRegistration_SetAllowedOrigins          7 int,var
#comfunc global ICoreWebView2CustomSchemeRegistration_get_HasAuthorityComponent  8 var
#comfunc global ICoreWebView2CustomSchemeRegistration_put_HasAuthorityComponent  9 int
; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。
; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。
; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。