Win32 API 日本語リファレンス
ホームGraphics.Printing › SpoolerFreePrinterNotifyInfo

SpoolerFreePrinterNotifyInfo

関数
スプーラーのプリンター通知情報を解放する。
DLLSPOOLSS.dll呼出規約winapi

シグネチャ

// SPOOLSS.dll
#include <windows.h>

void SpoolerFreePrinterNotifyInfo(
    PRINTER_NOTIFY_INFO* pInfo
);

パラメーター

名前方向
pInfoPRINTER_NOTIFY_INFO*in

戻り値の型: void

各言語での呼び出し定義

// SPOOLSS.dll
#include <windows.h>

void SpoolerFreePrinterNotifyInfo(
    PRINTER_NOTIFY_INFO* pInfo
);
[DllImport("SPOOLSS.dll", ExactSpelling = true)]
static extern void SpoolerFreePrinterNotifyInfo(
    IntPtr pInfo   // PRINTER_NOTIFY_INFO*
);
<DllImport("SPOOLSS.dll", ExactSpelling:=True)>
Public Shared Sub SpoolerFreePrinterNotifyInfo(
    pInfo As IntPtr   ' PRINTER_NOTIFY_INFO*
)
End Sub
' pInfo : PRINTER_NOTIFY_INFO*
Declare PtrSafe Sub SpoolerFreePrinterNotifyInfo Lib "spoolss" ( _
    ByVal pInfo As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SpoolerFreePrinterNotifyInfo = ctypes.windll.spoolss.SpoolerFreePrinterNotifyInfo
SpoolerFreePrinterNotifyInfo.restype = None
SpoolerFreePrinterNotifyInfo.argtypes = [
    ctypes.c_void_p,  # pInfo : PRINTER_NOTIFY_INFO*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SPOOLSS.dll')
SpoolerFreePrinterNotifyInfo = Fiddle::Function.new(
  lib['SpoolerFreePrinterNotifyInfo'],
  [
    Fiddle::TYPE_VOIDP,  # pInfo : PRINTER_NOTIFY_INFO*
  ],
  Fiddle::TYPE_VOID)
#[link(name = "spoolss")]
extern "system" {
    fn SpoolerFreePrinterNotifyInfo(
        pInfo: *mut PRINTER_NOTIFY_INFO  // PRINTER_NOTIFY_INFO*
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("SPOOLSS.dll")]
public static extern void SpoolerFreePrinterNotifyInfo(IntPtr pInfo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SPOOLSS_SpoolerFreePrinterNotifyInfo' -Namespace Win32 -PassThru
# $api::SpoolerFreePrinterNotifyInfo(pInfo)
#uselib "SPOOLSS.dll"
#func global SpoolerFreePrinterNotifyInfo "SpoolerFreePrinterNotifyInfo" sptr
; SpoolerFreePrinterNotifyInfo varptr(pInfo)
; pInfo : PRINTER_NOTIFY_INFO* -> "sptr"
出力引数:
#uselib "SPOOLSS.dll"
#func global SpoolerFreePrinterNotifyInfo "SpoolerFreePrinterNotifyInfo" var
; SpoolerFreePrinterNotifyInfo pInfo
; pInfo : PRINTER_NOTIFY_INFO* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void SpoolerFreePrinterNotifyInfo(PRINTER_NOTIFY_INFO* pInfo)
#uselib "SPOOLSS.dll"
#func global SpoolerFreePrinterNotifyInfo "SpoolerFreePrinterNotifyInfo" var
; SpoolerFreePrinterNotifyInfo pInfo
; pInfo : PRINTER_NOTIFY_INFO* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	spoolss = windows.NewLazySystemDLL("SPOOLSS.dll")
	procSpoolerFreePrinterNotifyInfo = spoolss.NewProc("SpoolerFreePrinterNotifyInfo")
)

// pInfo (PRINTER_NOTIFY_INFO*)
r1, _, err := procSpoolerFreePrinterNotifyInfo.Call(
	uintptr(pInfo),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure SpoolerFreePrinterNotifyInfo(
  pInfo: Pointer   // PRINTER_NOTIFY_INFO*
); stdcall;
  external 'SPOOLSS.dll' name 'SpoolerFreePrinterNotifyInfo';
result := DllCall("SPOOLSS\SpoolerFreePrinterNotifyInfo"
    , "Ptr", pInfo   ; PRINTER_NOTIFY_INFO*
    , "Int")   ; return: void
●SpoolerFreePrinterNotifyInfo(pInfo) = DLL("SPOOLSS.dll", "int SpoolerFreePrinterNotifyInfo(void*)")
# 呼び出し: SpoolerFreePrinterNotifyInfo(pInfo)
# pInfo : PRINTER_NOTIFY_INFO* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。