Win32 API 日本語リファレンス
ホームNetworkManagement.NetManagement › NetScheduleJobDel

NetScheduleJobDel

関数
指定範囲のスケジュール済みジョブをキューから削除する。
DLLNETAPI32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

DWORD NetScheduleJobDel(
    LPCWSTR Servername,
    DWORD MinJobId,
    DWORD MaxJobId
);

パラメーター

名前方向
ServernameLPCWSTRin
MinJobIdDWORDin
MaxJobIdDWORDin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD NetScheduleJobDel(
    LPCWSTR Servername,
    DWORD MinJobId,
    DWORD MaxJobId
);
[DllImport("NETAPI32.dll", ExactSpelling = true)]
static extern uint NetScheduleJobDel(
    [MarshalAs(UnmanagedType.LPWStr)] string Servername,   // LPCWSTR
    uint MinJobId,   // DWORD
    uint MaxJobId   // DWORD
);
<DllImport("NETAPI32.dll", ExactSpelling:=True)>
Public Shared Function NetScheduleJobDel(
    <MarshalAs(UnmanagedType.LPWStr)> Servername As String,   ' LPCWSTR
    MinJobId As UInteger,   ' DWORD
    MaxJobId As UInteger   ' DWORD
) As UInteger
End Function
' Servername : LPCWSTR
' MinJobId : DWORD
' MaxJobId : DWORD
Declare PtrSafe Function NetScheduleJobDel Lib "netapi32" ( _
    ByVal Servername As LongPtr, _
    ByVal MinJobId As Long, _
    ByVal MaxJobId As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

NetScheduleJobDel = ctypes.windll.netapi32.NetScheduleJobDel
NetScheduleJobDel.restype = wintypes.DWORD
NetScheduleJobDel.argtypes = [
    wintypes.LPCWSTR,  # Servername : LPCWSTR
    wintypes.DWORD,  # MinJobId : DWORD
    wintypes.DWORD,  # MaxJobId : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('NETAPI32.dll')
NetScheduleJobDel = Fiddle::Function.new(
  lib['NetScheduleJobDel'],
  [
    Fiddle::TYPE_VOIDP,  # Servername : LPCWSTR
    -Fiddle::TYPE_INT,  # MinJobId : DWORD
    -Fiddle::TYPE_INT,  # MaxJobId : DWORD
  ],
  -Fiddle::TYPE_INT)
#[link(name = "netapi32")]
extern "system" {
    fn NetScheduleJobDel(
        Servername: *const u16,  // LPCWSTR
        MinJobId: u32,  // DWORD
        MaxJobId: u32  // DWORD
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("NETAPI32.dll")]
public static extern uint NetScheduleJobDel([MarshalAs(UnmanagedType.LPWStr)] string Servername, uint MinJobId, uint MaxJobId);
"@
$api = Add-Type -MemberDefinition $sig -Name 'NETAPI32_NetScheduleJobDel' -Namespace Win32 -PassThru
# $api::NetScheduleJobDel(Servername, MinJobId, MaxJobId)
#uselib "NETAPI32.dll"
#func global NetScheduleJobDel "NetScheduleJobDel" sptr, sptr, sptr
; NetScheduleJobDel Servername, MinJobId, MaxJobId   ; 戻り値は stat
; Servername : LPCWSTR -> "sptr"
; MinJobId : DWORD -> "sptr"
; MaxJobId : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "NETAPI32.dll"
#cfunc global NetScheduleJobDel "NetScheduleJobDel" wstr, int, int
; res = NetScheduleJobDel(Servername, MinJobId, MaxJobId)
; Servername : LPCWSTR -> "wstr"
; MinJobId : DWORD -> "int"
; MaxJobId : DWORD -> "int"
; DWORD NetScheduleJobDel(LPCWSTR Servername, DWORD MinJobId, DWORD MaxJobId)
#uselib "NETAPI32.dll"
#cfunc global NetScheduleJobDel "NetScheduleJobDel" wstr, int, int
; res = NetScheduleJobDel(Servername, MinJobId, MaxJobId)
; Servername : LPCWSTR -> "wstr"
; MinJobId : DWORD -> "int"
; MaxJobId : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	netapi32 = windows.NewLazySystemDLL("NETAPI32.dll")
	procNetScheduleJobDel = netapi32.NewProc("NetScheduleJobDel")
)

// Servername (LPCWSTR), MinJobId (DWORD), MaxJobId (DWORD)
r1, _, err := procNetScheduleJobDel.Call(
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(Servername))),
	uintptr(MinJobId),
	uintptr(MaxJobId),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function NetScheduleJobDel(
  Servername: PWideChar;   // LPCWSTR
  MinJobId: DWORD;   // DWORD
  MaxJobId: DWORD   // DWORD
): DWORD; stdcall;
  external 'NETAPI32.dll' name 'NetScheduleJobDel';
result := DllCall("NETAPI32\NetScheduleJobDel"
    , "WStr", Servername   ; LPCWSTR
    , "UInt", MinJobId   ; DWORD
    , "UInt", MaxJobId   ; DWORD
    , "UInt")   ; return: DWORD
●NetScheduleJobDel(Servername, MinJobId, MaxJobId) = DLL("NETAPI32.dll", "dword NetScheduleJobDel(char*, dword, dword)")
# 呼び出し: NetScheduleJobDel(Servername, MinJobId, MaxJobId)
# Servername : LPCWSTR -> "char*"
# MinJobId : DWORD -> "dword"
# MaxJobId : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。