Win32 API 日本語リファレンス
ホームUI.Shell › PARSEDURLW

PARSEDURLW

構造体
サイズx64: 40 バイト / x86: 24 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のサイズをバイト単位で指定する。呼び出し前に設定する。
pszProtocolLPWSTR8/4+8+4解析された URL のプロトコル部分へのポインタ(Unicode)。
cchProtocolDWORD4+16+8プロトコル部分の文字数。
pszSuffixLPWSTR8/4+24+12プロトコル以降のサフィックス部分へのポインタ(Unicode)。
cchSuffixDWORD4+32+16サフィックス部分の文字数。
nSchemeDWORD4+36+20URL のスキーム種別を示す値(URL_SCHEME_ 系)。

各言語での定義

#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 Structure
import 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: uint32
struct 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