Win32 API 日本語リファレンス
ホームWeb.InternetExplorer › RatingCheckUserAccessW

RatingCheckUserAccessW

関数
ユーザのURLへのアクセス可否を評価で確認する(Unicode版)。
DLLMSRATING.dll文字セットUnicode (-W)呼出規約winapi

シグネチャ

// MSRATING.dll  (Unicode / -W)
#include <windows.h>

HRESULT RatingCheckUserAccessW(
    LPCWSTR pszUsername,   // optional
    LPCWSTR pszURL,   // optional
    LPCWSTR pszRatingInfo,   // optional
    BYTE* pData,   // optional
    DWORD cbData,
    void** ppRatingDetails   // optional
);

パラメーター

名前方向説明
pszUsernameLPCWSTRinoptionalアクセス可否を判定する対象ユーザー名を指すワイド文字列を指定する。NULL可。
pszURLLPCWSTRinoptional評価対象となるコンテンツのURLを指すワイド文字列を指定する。
pszRatingInfoLPCWSTRinoptionalコンテンツの評価(レーティング)情報を指すワイド文字列を指定する。NULL可。
pDataBYTE*inoptional評価ラベル等の追加データを格納したバッファへのポインタを指定する。NULL可。
cbDataDWORDinpDataのサイズをバイト単位で指定する。
ppRatingDetailsvoid**outoptionalアクセス拒否時の評価詳細情報を受け取るポインタを指定する。後でRatingFreeDetailsで解放する。

戻り値の型: HRESULT

各言語での呼び出し定義

// MSRATING.dll  (Unicode / -W)
#include <windows.h>

HRESULT RatingCheckUserAccessW(
    LPCWSTR pszUsername,   // optional
    LPCWSTR pszURL,   // optional
    LPCWSTR pszRatingInfo,   // optional
    BYTE* pData,   // optional
    DWORD cbData,
    void** ppRatingDetails   // optional
);
[DllImport("MSRATING.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int RatingCheckUserAccessW(
    [MarshalAs(UnmanagedType.LPWStr)] string pszUsername,   // LPCWSTR optional
    [MarshalAs(UnmanagedType.LPWStr)] string pszURL,   // LPCWSTR optional
    [MarshalAs(UnmanagedType.LPWStr)] string pszRatingInfo,   // LPCWSTR optional
    IntPtr pData,   // BYTE* optional
    uint cbData,   // DWORD
    IntPtr ppRatingDetails   // void** optional, out
);
<DllImport("MSRATING.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function RatingCheckUserAccessW(
    <MarshalAs(UnmanagedType.LPWStr)> pszUsername As String,   ' LPCWSTR optional
    <MarshalAs(UnmanagedType.LPWStr)> pszURL As String,   ' LPCWSTR optional
    <MarshalAs(UnmanagedType.LPWStr)> pszRatingInfo As String,   ' LPCWSTR optional
    pData As IntPtr,   ' BYTE* optional
    cbData As UInteger,   ' DWORD
    ppRatingDetails As IntPtr   ' void** optional, out
) As Integer
End Function
' pszUsername : LPCWSTR optional
' pszURL : LPCWSTR optional
' pszRatingInfo : LPCWSTR optional
' pData : BYTE* optional
' cbData : DWORD
' ppRatingDetails : void** optional, out
Declare PtrSafe Function RatingCheckUserAccessW Lib "msrating" ( _
    ByVal pszUsername As LongPtr, _
    ByVal pszURL As LongPtr, _
    ByVal pszRatingInfo As LongPtr, _
    ByVal pData As LongPtr, _
    ByVal cbData As Long, _
    ByVal ppRatingDetails As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RatingCheckUserAccessW = ctypes.windll.msrating.RatingCheckUserAccessW
RatingCheckUserAccessW.restype = ctypes.c_int
RatingCheckUserAccessW.argtypes = [
    wintypes.LPCWSTR,  # pszUsername : LPCWSTR optional
    wintypes.LPCWSTR,  # pszURL : LPCWSTR optional
    wintypes.LPCWSTR,  # pszRatingInfo : LPCWSTR optional
    ctypes.POINTER(ctypes.c_ubyte),  # pData : BYTE* optional
    wintypes.DWORD,  # cbData : DWORD
    ctypes.c_void_p,  # ppRatingDetails : void** optional, out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MSRATING.dll')
RatingCheckUserAccessW = Fiddle::Function.new(
  lib['RatingCheckUserAccessW'],
  [
    Fiddle::TYPE_VOIDP,  # pszUsername : LPCWSTR optional
    Fiddle::TYPE_VOIDP,  # pszURL : LPCWSTR optional
    Fiddle::TYPE_VOIDP,  # pszRatingInfo : LPCWSTR optional
    Fiddle::TYPE_VOIDP,  # pData : BYTE* optional
    -Fiddle::TYPE_INT,  # cbData : DWORD
    Fiddle::TYPE_VOIDP,  # ppRatingDetails : void** optional, out
  ],
  Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"
#[link(name = "msrating")]
extern "system" {
    fn RatingCheckUserAccessW(
        pszUsername: *const u16,  // LPCWSTR optional
        pszURL: *const u16,  // LPCWSTR optional
        pszRatingInfo: *const u16,  // LPCWSTR optional
        pData: *mut u8,  // BYTE* optional
        cbData: u32,  // DWORD
        ppRatingDetails: *mut *mut ()  // void** optional, out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MSRATING.dll", CharSet = CharSet.Unicode)]
public static extern int RatingCheckUserAccessW([MarshalAs(UnmanagedType.LPWStr)] string pszUsername, [MarshalAs(UnmanagedType.LPWStr)] string pszURL, [MarshalAs(UnmanagedType.LPWStr)] string pszRatingInfo, IntPtr pData, uint cbData, IntPtr ppRatingDetails);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSRATING_RatingCheckUserAccessW' -Namespace Win32 -PassThru
# $api::RatingCheckUserAccessW(pszUsername, pszURL, pszRatingInfo, pData, cbData, ppRatingDetails)
#uselib "MSRATING.dll"
#func global RatingCheckUserAccessW "RatingCheckUserAccessW" wptr, wptr, wptr, wptr, wptr, wptr
; RatingCheckUserAccessW pszUsername, pszURL, pszRatingInfo, varptr(pData), cbData, ppRatingDetails   ; 戻り値は stat
; pszUsername : LPCWSTR optional -> "wptr"
; pszURL : LPCWSTR optional -> "wptr"
; pszRatingInfo : LPCWSTR optional -> "wptr"
; pData : BYTE* optional -> "wptr"
; cbData : DWORD -> "wptr"
; ppRatingDetails : void** optional, out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "MSRATING.dll"
#cfunc global RatingCheckUserAccessW "RatingCheckUserAccessW" wstr, wstr, wstr, var, int, sptr
; res = RatingCheckUserAccessW(pszUsername, pszURL, pszRatingInfo, pData, cbData, ppRatingDetails)
; pszUsername : LPCWSTR optional -> "wstr"
; pszURL : LPCWSTR optional -> "wstr"
; pszRatingInfo : LPCWSTR optional -> "wstr"
; pData : BYTE* optional -> "var"
; cbData : DWORD -> "int"
; ppRatingDetails : void** optional, out -> "sptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT RatingCheckUserAccessW(LPCWSTR pszUsername, LPCWSTR pszURL, LPCWSTR pszRatingInfo, BYTE* pData, DWORD cbData, void** ppRatingDetails)
#uselib "MSRATING.dll"
#cfunc global RatingCheckUserAccessW "RatingCheckUserAccessW" wstr, wstr, wstr, var, int, intptr
; res = RatingCheckUserAccessW(pszUsername, pszURL, pszRatingInfo, pData, cbData, ppRatingDetails)
; pszUsername : LPCWSTR optional -> "wstr"
; pszURL : LPCWSTR optional -> "wstr"
; pszRatingInfo : LPCWSTR optional -> "wstr"
; pData : BYTE* optional -> "var"
; cbData : DWORD -> "int"
; ppRatingDetails : void** optional, out -> "intptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msrating = windows.NewLazySystemDLL("MSRATING.dll")
	procRatingCheckUserAccessW = msrating.NewProc("RatingCheckUserAccessW")
)

// pszUsername (LPCWSTR optional), pszURL (LPCWSTR optional), pszRatingInfo (LPCWSTR optional), pData (BYTE* optional), cbData (DWORD), ppRatingDetails (void** optional, out)
r1, _, err := procRatingCheckUserAccessW.Call(
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszUsername))),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszURL))),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszRatingInfo))),
	uintptr(pData),
	uintptr(cbData),
	uintptr(ppRatingDetails),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function RatingCheckUserAccessW(
  pszUsername: PWideChar;   // LPCWSTR optional
  pszURL: PWideChar;   // LPCWSTR optional
  pszRatingInfo: PWideChar;   // LPCWSTR optional
  pData: Pointer;   // BYTE* optional
  cbData: DWORD;   // DWORD
  ppRatingDetails: Pointer   // void** optional, out
): Integer; stdcall;
  external 'MSRATING.dll' name 'RatingCheckUserAccessW';
result := DllCall("MSRATING\RatingCheckUserAccessW"
    , "WStr", pszUsername   ; LPCWSTR optional
    , "WStr", pszURL   ; LPCWSTR optional
    , "WStr", pszRatingInfo   ; LPCWSTR optional
    , "Ptr", pData   ; BYTE* optional
    , "UInt", cbData   ; DWORD
    , "Ptr", ppRatingDetails   ; void** optional, out
    , "Int")   ; return: HRESULT
●RatingCheckUserAccessW(pszUsername, pszURL, pszRatingInfo, pData, cbData, ppRatingDetails) = DLL("MSRATING.dll", "int RatingCheckUserAccessW(char*, char*, char*, void*, dword, void*)")
# 呼び出し: RatingCheckUserAccessW(pszUsername, pszURL, pszRatingInfo, pData, cbData, ppRatingDetails)
# pszUsername : LPCWSTR optional -> "char*"
# pszURL : LPCWSTR optional -> "char*"
# pszRatingInfo : LPCWSTR optional -> "char*"
# pData : BYTE* optional -> "void*"
# cbData : DWORD -> "dword"
# ppRatingDetails : void** optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。