ReactOS 0.4.16-dev-306-g647d351
schedule.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: NetAPI DLL
4 * FILE: reactos/dll/win32/netapi32/schedule.c
5 * PURPOSE: Scheduler service interface code
6 *
7 * PROGRAMMERS: Eric Kohl
8 */
9
10/* INCLUDES ******************************************************************/
11
12#include "netapi32.h"
13#include "atsvc_c.h"
14
16
17/* FUNCTIONS *****************************************************************/
18
21{
23 LPWSTR pszStringBinding;
25
26 TRACE("ATSVC_HANDLE_bind() called\n");
27
29 L"ncacn_np",
30 (RPC_WSTR)pszSystemName,
31 L"\\pipe\\atsvc",
32 NULL,
33 &pszStringBinding);
34 if (status)
35 {
36 TRACE("RpcStringBindingCompose returned 0x%x\n", status);
37 return NULL;
38 }
39
40 /* Set the binding handle that will be used to bind to the server. */
41 status = RpcBindingFromStringBindingW(pszStringBinding,
42 &hBinding);
43 if (status)
44 {
45 TRACE("RpcBindingFromStringBinding returned 0x%x\n", status);
46 }
47
48 status = RpcStringFreeW(&pszStringBinding);
49 if (status)
50 {
51// TRACE("RpcStringFree returned 0x%x\n", status);
52 }
53
54 return hBinding;
55}
56
57
58void __RPC_USER
61{
63
64 TRACE("ATSVC_HANDLE_unbind() called\n");
65
67 if (status)
68 {
69 TRACE("RpcBindingFree returned 0x%x\n", status);
70 }
71}
72
73
77 LPCWSTR ServerName,
79 LPDWORD JobId)
80{
82
83 TRACE("NetScheduleJobAdd(%s, %p, %p)\n", debugstr_w(ServerName),
84 Buffer, JobId);
85
87 {
88 status = NetrJobAdd(ServerName,
90 JobId);
91 }
93 {
95 }
97
98 return status;
99}
100
101
103WINAPI
105 LPCWSTR ServerName,
106 DWORD MinJobId,
107 DWORD MaxJobId)
108{
110
111 TRACE("NetScheduleJobDel(%s, %d, %d)\n", debugstr_w(ServerName),
112 MinJobId, MaxJobId);
113
115 {
116 status = NetrJobDel(ServerName,
117 MinJobId,
118 MaxJobId);
119 }
121 {
123 }
125
126 return status;
127}
128
129
131WINAPI
133 LPCWSTR ServerName,
134 LPBYTE *PointerToBuffer,
135 DWORD PreferredMaximumLength,
136 LPDWORD EntriesRead,
137 LPDWORD TotalEntries,
138 LPDWORD ResumeHandle)
139{
140 AT_ENUM_CONTAINER EnumContainer;
142
143 TRACE("NetScheduleJobEnum(%s, %p, %d, %p, %p, %p)\n", debugstr_w(ServerName),
144 PointerToBuffer, PreferredMaximumLength, EntriesRead, TotalEntries, ResumeHandle);
145
146 EnumContainer.EntriesRead = 0;
147 EnumContainer.Buffer = NULL;
148
150 {
151 status = NetrJobEnum(ServerName,
152 &EnumContainer,
153 PreferredMaximumLength,
154 TotalEntries,
155 ResumeHandle);
157 {
158 *PointerToBuffer = (LPBYTE)EnumContainer.Buffer;
159 *EntriesRead = EnumContainer.EntriesRead;
160 }
161 }
163 {
165 }
167
168 return status;
169}
170
171
173WINAPI
175 LPCWSTR ServerName,
176 DWORD JobId,
177 LPBYTE *PointerToBuffer)
178{
180
181 TRACE("NetScheduleJobGetInfo(%s, %d, %p)\n", debugstr_w(ServerName),
182 JobId, PointerToBuffer);
183
185 {
186 status = NetrJobGetInfo(ServerName,
187 JobId,
188 (LPAT_INFO *)PointerToBuffer);
189 }
191 {
193 }
195
196 return status;
197}
198
199/* EOF */
const wchar_t * ATSVC_HANDLE
Definition: atsvc.idl:7
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
NET_API_STATUS WINAPI NetrJobDel(ATSVC_HANDLE ServerName, DWORD MinJobId, DWORD MaxJobId)
Definition: rpcserver.c:145
NET_API_STATUS WINAPI NetrJobAdd(ATSVC_HANDLE ServerName, LPAT_INFO pAtInfo, LPDWORD pJobId)
Definition: rpcserver.c:84
NET_API_STATUS WINAPI NetrJobGetInfo(ATSVC_HANDLE ServerName, DWORD JobId, LPAT_INFO *ppAtInfo)
Definition: rpcserver.c:335
NET_API_STATUS __stdcall NetrJobEnum(ATSVC_HANDLE ServerName, LPAT_ENUM_CONTAINER pEnumContainer, DWORD PreferedMaximumLength, LPDWORD pTotalEntries, LPDWORD pResumeHandle)
Definition: rpcserver.c:204
Definition: bufpool.h:45
handle_t hBinding
Definition: ctx_c.c:54
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define NULL
Definition: types.h:112
unsigned long DWORD
Definition: ntddk_ex.h:95
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define debugstr_w
Definition: kernel32.h:32
#define NERR_Success
Definition: lmerr.h:5
DWORD NET_API_STATUS
Definition: ms-dtyp.idl:91
#define L(x)
Definition: ntvdm.h:50
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:880
RPC_STATUS WINAPI RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR *StringBinding)
Definition: rpc_binding.c:510
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:787
unsigned short * RPC_WSTR
Definition: rpcdce.h:46
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:740
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:175
NET_API_STATUS WINAPI NetScheduleJobGetInfo(LPCWSTR ServerName, DWORD JobId, LPBYTE *PointerToBuffer)
Definition: schedule.c:174
void __RPC_USER ATSVC_HANDLE_unbind(ATSVC_HANDLE pszSystemName, handle_t hBinding)
Definition: schedule.c:59
NET_API_STATUS WINAPI NetScheduleJobAdd(LPCWSTR ServerName, LPBYTE Buffer, LPDWORD JobId)
Definition: schedule.c:76
handle_t __RPC_USER ATSVC_HANDLE_bind(ATSVC_HANDLE pszSystemName)
Definition: schedule.c:20
NET_API_STATUS WINAPI NetScheduleJobDel(LPCWSTR ServerName, DWORD MinJobId, DWORD MaxJobId)
Definition: schedule.c:104
NET_API_STATUS WINAPI NetScheduleJobEnum(LPCWSTR ServerName, LPBYTE *PointerToBuffer, DWORD PreferredMaximumLength, LPDWORD EntriesRead, LPDWORD TotalEntries, LPDWORD ResumeHandle)
Definition: schedule.c:132
#define RpcEndExcept
Definition: rpc.h:128
#define RpcTryExcept
Definition: rpc.h:126
#define RpcExcept(expr)
Definition: rpc.h:127
long RPC_STATUS
Definition: rpc.h:52
#define __RPC_USER
Definition: rpc.h:65
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
DWORD EntriesRead
Definition: atsvc.idl:30
LPAT_ENUM Buffer
Definition: atsvc.idl:31
Definition: lmat.h:22
Definition: ps.c:97
unsigned char * LPBYTE
Definition: typedefs.h:53
uint32_t * LPDWORD
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185