ホーム › System.DataExchange › DdeSetQualityOfService
DdeSetQualityOfService
関数DDEクライアントのサービス品質(QoS)を設定する。
シグネチャ
// USER32.dll
#include <windows.h>
BOOL DdeSetQualityOfService(
HWND hwndClient,
const SECURITY_QUALITY_OF_SERVICE* pqosNew,
SECURITY_QUALITY_OF_SERVICE* pqosPrev
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hwndClient | HWND | in |
| pqosNew | SECURITY_QUALITY_OF_SERVICE* | in |
| pqosPrev | SECURITY_QUALITY_OF_SERVICE* | inout |
戻り値の型: BOOL
各言語での呼び出し定義
// USER32.dll
#include <windows.h>
BOOL DdeSetQualityOfService(
HWND hwndClient,
const SECURITY_QUALITY_OF_SERVICE* pqosNew,
SECURITY_QUALITY_OF_SERVICE* pqosPrev
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool DdeSetQualityOfService(
IntPtr hwndClient, // HWND
IntPtr pqosNew, // SECURITY_QUALITY_OF_SERVICE*
IntPtr pqosPrev // SECURITY_QUALITY_OF_SERVICE* in/out
);<DllImport("USER32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function DdeSetQualityOfService(
hwndClient As IntPtr, ' HWND
pqosNew As IntPtr, ' SECURITY_QUALITY_OF_SERVICE*
pqosPrev As IntPtr ' SECURITY_QUALITY_OF_SERVICE* in/out
) As Boolean
End Function' hwndClient : HWND
' pqosNew : SECURITY_QUALITY_OF_SERVICE*
' pqosPrev : SECURITY_QUALITY_OF_SERVICE* in/out
Declare PtrSafe Function DdeSetQualityOfService Lib "user32" ( _
ByVal hwndClient As LongPtr, _
ByVal pqosNew As LongPtr, _
ByVal pqosPrev As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
DdeSetQualityOfService = ctypes.windll.user32.DdeSetQualityOfService
DdeSetQualityOfService.restype = wintypes.BOOL
DdeSetQualityOfService.argtypes = [
wintypes.HANDLE, # hwndClient : HWND
ctypes.c_void_p, # pqosNew : SECURITY_QUALITY_OF_SERVICE*
ctypes.c_void_p, # pqosPrev : SECURITY_QUALITY_OF_SERVICE* in/out
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('USER32.dll')
DdeSetQualityOfService = Fiddle::Function.new(
lib['DdeSetQualityOfService'],
[
Fiddle::TYPE_VOIDP, # hwndClient : HWND
Fiddle::TYPE_VOIDP, # pqosNew : SECURITY_QUALITY_OF_SERVICE*
Fiddle::TYPE_VOIDP, # pqosPrev : SECURITY_QUALITY_OF_SERVICE* in/out
],
Fiddle::TYPE_INT)#[link(name = "user32")]
extern "system" {
fn DdeSetQualityOfService(
hwndClient: *mut core::ffi::c_void, // HWND
pqosNew: *const SECURITY_QUALITY_OF_SERVICE, // SECURITY_QUALITY_OF_SERVICE*
pqosPrev: *mut SECURITY_QUALITY_OF_SERVICE // SECURITY_QUALITY_OF_SERVICE* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll", SetLastError = true)]
public static extern bool DdeSetQualityOfService(IntPtr hwndClient, IntPtr pqosNew, IntPtr pqosPrev);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_DdeSetQualityOfService' -Namespace Win32 -PassThru
# $api::DdeSetQualityOfService(hwndClient, pqosNew, pqosPrev)#uselib "USER32.dll"
#func global DdeSetQualityOfService "DdeSetQualityOfService" sptr, sptr, sptr
; DdeSetQualityOfService hwndClient, varptr(pqosNew), varptr(pqosPrev) ; 戻り値は stat
; hwndClient : HWND -> "sptr"
; pqosNew : SECURITY_QUALITY_OF_SERVICE* -> "sptr"
; pqosPrev : SECURITY_QUALITY_OF_SERVICE* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "USER32.dll" #cfunc global DdeSetQualityOfService "DdeSetQualityOfService" sptr, var, var ; res = DdeSetQualityOfService(hwndClient, pqosNew, pqosPrev) ; hwndClient : HWND -> "sptr" ; pqosNew : SECURITY_QUALITY_OF_SERVICE* -> "var" ; pqosPrev : SECURITY_QUALITY_OF_SERVICE* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "USER32.dll" #cfunc global DdeSetQualityOfService "DdeSetQualityOfService" sptr, sptr, sptr ; res = DdeSetQualityOfService(hwndClient, varptr(pqosNew), varptr(pqosPrev)) ; hwndClient : HWND -> "sptr" ; pqosNew : SECURITY_QUALITY_OF_SERVICE* -> "sptr" ; pqosPrev : SECURITY_QUALITY_OF_SERVICE* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOL DdeSetQualityOfService(HWND hwndClient, SECURITY_QUALITY_OF_SERVICE* pqosNew, SECURITY_QUALITY_OF_SERVICE* pqosPrev) #uselib "USER32.dll" #cfunc global DdeSetQualityOfService "DdeSetQualityOfService" intptr, var, var ; res = DdeSetQualityOfService(hwndClient, pqosNew, pqosPrev) ; hwndClient : HWND -> "intptr" ; pqosNew : SECURITY_QUALITY_OF_SERVICE* -> "var" ; pqosPrev : SECURITY_QUALITY_OF_SERVICE* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL DdeSetQualityOfService(HWND hwndClient, SECURITY_QUALITY_OF_SERVICE* pqosNew, SECURITY_QUALITY_OF_SERVICE* pqosPrev) #uselib "USER32.dll" #cfunc global DdeSetQualityOfService "DdeSetQualityOfService" intptr, intptr, intptr ; res = DdeSetQualityOfService(hwndClient, varptr(pqosNew), varptr(pqosPrev)) ; hwndClient : HWND -> "intptr" ; pqosNew : SECURITY_QUALITY_OF_SERVICE* -> "intptr" ; pqosPrev : SECURITY_QUALITY_OF_SERVICE* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
user32 = windows.NewLazySystemDLL("USER32.dll")
procDdeSetQualityOfService = user32.NewProc("DdeSetQualityOfService")
)
// hwndClient (HWND), pqosNew (SECURITY_QUALITY_OF_SERVICE*), pqosPrev (SECURITY_QUALITY_OF_SERVICE* in/out)
r1, _, err := procDdeSetQualityOfService.Call(
uintptr(hwndClient),
uintptr(pqosNew),
uintptr(pqosPrev),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction DdeSetQualityOfService(
hwndClient: THandle; // HWND
pqosNew: Pointer; // SECURITY_QUALITY_OF_SERVICE*
pqosPrev: Pointer // SECURITY_QUALITY_OF_SERVICE* in/out
): BOOL; stdcall;
external 'USER32.dll' name 'DdeSetQualityOfService';result := DllCall("USER32\DdeSetQualityOfService"
, "Ptr", hwndClient ; HWND
, "Ptr", pqosNew ; SECURITY_QUALITY_OF_SERVICE*
, "Ptr", pqosPrev ; SECURITY_QUALITY_OF_SERVICE* in/out
, "Int") ; return: BOOL●DdeSetQualityOfService(hwndClient, pqosNew, pqosPrev) = DLL("USER32.dll", "bool DdeSetQualityOfService(void*, void*, void*)")
# 呼び出し: DdeSetQualityOfService(hwndClient, pqosNew, pqosPrev)
# hwndClient : HWND -> "void*"
# pqosNew : SECURITY_QUALITY_OF_SERVICE* -> "void*"
# pqosPrev : SECURITY_QUALITY_OF_SERVICE* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。