PARSEDURLA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | [in] 構造体のサイズ (バイト単位)。呼び出し元のアプリケーションは、ParseURL 関数を呼び出す前にこのメンバーを設定する必要があります。 |
| pszProtocol | LPSTR | 8/4 | +8 | +4 | [out] URL のプロトコル部分の先頭を指すポインター。 |
| cchProtocol | DWORD | 4 | +16 | +8 | [out] URL のプロトコル部分の文字数。 |
| pszSuffix | LPSTR | 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 ヘッダーは PARSEDURL をエイリアスとして定義しており、UNICODE プリプロセッサ定数の定義に応じてこの関数の ANSI 版と Unicode 版が自動的に選択されます。エンコードに依存しないエイリアスと、エンコードに依存するコードを混在させると、不一致が生じてコンパイルエラーや実行時エラーの原因となる場合があります。詳細については、関数プロトタイプの規則 を参照してください。
出典・ライセンス: 上記「公式ドキュメント」の内容は 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>
// PARSEDURLA (x64 40 / x86 24 バイト)
typedef struct PARSEDURLA {
DWORD cbSize;
LPSTR pszProtocol;
DWORD cchProtocol;
LPSTR pszSuffix;
DWORD cchSuffix;
DWORD nScheme;
} PARSEDURLA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PARSEDURLA
{
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 PARSEDURLA
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 PARSEDURLA(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 PARSEDURLA {
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 PARSEDURLA struct {
cbSize uint32
pszProtocol uintptr
cchProtocol uint32
pszSuffix uintptr
cchSuffix uint32
nScheme uint32
}type
PARSEDURLA = record
cbSize: DWORD;
pszProtocol: Pointer;
cchProtocol: DWORD;
pszSuffix: Pointer;
cchSuffix: DWORD;
nScheme: DWORD;
end;const PARSEDURLA = extern struct {
cbSize: u32,
pszProtocol: ?*anyopaque,
cchProtocol: u32,
pszSuffix: ?*anyopaque,
cchSuffix: u32,
nScheme: u32,
};type
PARSEDURLA {.bycopy.} = object
cbSize: uint32
pszProtocol: pointer
cchProtocol: uint32
pszSuffix: pointer
cchSuffix: uint32
nScheme: uint32struct PARSEDURLA
{
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 レイアウト)
; PARSEDURLA サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pszProtocol : LPSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; cchProtocol : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pszSuffix : LPSTR (+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 レイアウト)
; PARSEDURLA サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pszProtocol : LPSTR (+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 : LPSTR (+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 PARSEDURLA
#field int cbSize
#field intptr pszProtocol
#field int cchProtocol
#field intptr pszSuffix
#field int cchSuffix
#field int nScheme
#endstruct
stdim st, PARSEDURLA ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize