ICoreWebView2CustomSchemeRegistration
COMメソッド 7
vtbl = vtable インデックス(0始まり)。HSP等からインデックス指定でCOMメソッドを呼ぶ際に使用します。0〜2 は IUnknown。
vtbl 3 HRESULT get_SchemeName(LPWSTR* schemeName)
| schemeName | LPWSTR* | out | 登録するカスタムスキームの名前を受け取る LPWSTR へのポインタである。呼び出し側が CoTaskMemFree で解放する。 |
vtbl 4 HRESULT get_TreatAsSecure(BOOL* treatAsSecure)
| treatAsSecure | BOOL* | out | このスキームを HTTPS と同様にセキュアとして扱うか否かを受け取る BOOL へのポインタである。 |
vtbl 5 HRESULT put_TreatAsSecure(BOOL value)
| value | BOOL | in | このスキームをセキュアとして扱うか否かを指定する BOOL である。 |
vtbl 6 HRESULT GetAllowedOrigins(DWORD* allowedOriginsCount, LPWSTR** allowedOrigins)
| allowedOriginsCount | DWORD* | out | 返される許可オリジン配列の要素数を受け取る DWORD へのポインタである。 |
| allowedOrigins | LPWSTR** | out | 許可オリジンの文字列配列を受け取る LPWSTR* の配列へのポインタである。呼び出し側が各要素および配列を解放する。 |
vtbl 7 HRESULT SetAllowedOrigins(DWORD allowedOriginsCount, LPWSTR* allowedOrigins)
| allowedOriginsCount | DWORD | in | 設定する許可オリジン配列の要素数を指定する DWORD である。 |
| allowedOrigins | LPWSTR* | in | このスキームへのアクセスを許可するオリジンの文字列配列(LPWSTR*)を指定する。 |
vtbl 8 HRESULT get_HasAuthorityComponent(BOOL* hasAuthorityComponent)
| hasAuthorityComponent | BOOL* | out | このスキームの URI が authority(ホスト)コンポーネントを持つか否かを受け取る BOOL へのポインタである。 |
vtbl 9 HRESULT put_HasAuthorityComponent(BOOL hasAuthorityComponent)
| hasAuthorityComponent | BOOL | in | このスキームの 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 方式にも切替可。#define global IID_ICoreWebView2CustomSchemeRegistration "{D60AC92C-37A6-4B26-A39E-95CFE59047BB}" #usecom global ICoreWebView2CustomSchemeRegistration IID_ICoreWebView2CustomSchemeRegistration "{}" #comfunc global ICoreWebView2CustomSchemeRegistration_get_SchemeName 3 sptr #comfunc global ICoreWebView2CustomSchemeRegistration_get_TreatAsSecure 4 sptr #comfunc global ICoreWebView2CustomSchemeRegistration_put_TreatAsSecure 5 int #comfunc global ICoreWebView2CustomSchemeRegistration_GetAllowedOrigins 6 sptr,sptr #comfunc global ICoreWebView2CustomSchemeRegistration_SetAllowedOrigins 7 int,sptr #comfunc global ICoreWebView2CustomSchemeRegistration_get_HasAuthorityComponent 8 sptr #comfunc global ICoreWebView2CustomSchemeRegistration_put_HasAuthorityComponent 9 int ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。