PARSEDURLA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で指定する。呼び出し前に設定する。 |
| pszProtocol | LPSTR | 8/4 | +8 | +4 | 解析された URL のプロトコル部分へのポインタ(ANSI)。 |
| cchProtocol | DWORD | 4 | +16 | +8 | プロトコル部分の文字数。 |
| pszSuffix | LPSTR | 8/4 | +24 | +12 | プロトコル以降のサフィックス部分へのポインタ(ANSI)。 |
| cchSuffix | DWORD | 4 | +32 | +16 | サフィックス部分の文字数。 |
| nScheme | DWORD | 4 | +36 | +20 | URL のスキーム種別を示す値(URL_SCHEME_ 系)。 |
各言語での定義
#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