PARSEDURLW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | [in] この構造体のサイズ (バイト単位)。呼び出し側のアプリケーションは、ParseURL 関数を呼び出す前にこのメンバーを設定する必要があります。 |
| pszProtocol | LPWSTR | 8/4 | +8 | +4 | [out] URL のプロトコル部分の先頭を指すポインター。 |
| cchProtocol | DWORD | 4 | +16 | +8 | [out] URL のプロトコル部分の文字数。 |
| pszSuffix | LPWSTR | 8/4 | +24 | +12 | [out] URL のうち、プロトコルとコロン (':') に続く部分を指すポインター。file URL の場合、この関数は先頭の "//" も読み飛ばします。 |
| cchSuffix | DWORD | 4 | +32 | +16 | [out] URL のサフィックス部分の文字数。 |
| nScheme | DWORD | 4 | +36 | +20 | [out] URL のスキームを指定する URL_SCHEME 列挙型の値。 |
公式ドキュメント
ParseURL 関数が解析結果の URL を返すために使用します。
解説(Remarks)
メモ
shlwapi.h ヘッダーは、UNICODE プリプロセッサ定数の定義に応じてこの関数の ANSI 版と Unicode 版を自動的に選択するエイリアスとして PARSEDURL を定義します。エンコーディング中立のエイリアスと、エンコーディング中立でないコードを混在させると、不一致が生じてコンパイルエラーや実行時エラーの原因となることがあります。詳細については、関数プロトタイプの規則を参照してください。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// PARSEDURLW (x64 40 / x86 24 バイト)
typedef struct PARSEDURLW {
DWORD cbSize;
LPWSTR pszProtocol;
DWORD cchProtocol;
LPWSTR pszSuffix;
DWORD cchSuffix;
DWORD nScheme;
} PARSEDURLW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PARSEDURLW
{
public uint cbSize;
public IntPtr pszProtocol;
public uint cchProtocol;
public IntPtr pszSuffix;
public uint cchSuffix;
public uint nScheme;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PARSEDURLW
Public cbSize As UInteger
Public pszProtocol As IntPtr
Public cchProtocol As UInteger
Public pszSuffix As IntPtr
Public cchSuffix As UInteger
Public nScheme As UInteger
End Structureimport ctypes
from ctypes import wintypes
class PARSEDURLW(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("pszProtocol", ctypes.c_void_p),
("cchProtocol", wintypes.DWORD),
("pszSuffix", ctypes.c_void_p),
("cchSuffix", wintypes.DWORD),
("nScheme", wintypes.DWORD),
]#[repr(C)]
pub struct PARSEDURLW {
pub cbSize: u32,
pub pszProtocol: *mut core::ffi::c_void,
pub cchProtocol: u32,
pub pszSuffix: *mut core::ffi::c_void,
pub cchSuffix: u32,
pub nScheme: u32,
}import "golang.org/x/sys/windows"
type PARSEDURLW struct {
cbSize uint32
pszProtocol uintptr
cchProtocol uint32
pszSuffix uintptr
cchSuffix uint32
nScheme uint32
}type
PARSEDURLW = record
cbSize: DWORD;
pszProtocol: Pointer;
cchProtocol: DWORD;
pszSuffix: Pointer;
cchSuffix: DWORD;
nScheme: DWORD;
end;const PARSEDURLW = extern struct {
cbSize: u32,
pszProtocol: ?*anyopaque,
cchProtocol: u32,
pszSuffix: ?*anyopaque,
cchSuffix: u32,
nScheme: u32,
};type
PARSEDURLW {.bycopy.} = object
cbSize: uint32
pszProtocol: pointer
cchProtocol: uint32
pszSuffix: pointer
cchSuffix: uint32
nScheme: uint32struct PARSEDURLW
{
uint cbSize;
void* pszProtocol;
uint cchProtocol;
void* pszSuffix;
uint cchSuffix;
uint nScheme;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; PARSEDURLW サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pszProtocol : LPWSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; cchProtocol : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pszSuffix : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; cchSuffix : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; nScheme : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PARSEDURLW サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pszProtocol : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; cchProtocol : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pszSuffix : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; cchSuffix : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; nScheme : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global PARSEDURLW
#field int cbSize
#field intptr pszProtocol
#field int cchProtocol
#field intptr pszSuffix
#field int cchSuffix
#field int nScheme
#endstruct
stdim st, PARSEDURLW ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize