Author: ekohl
Date: Sun Mar 22 21:57:55 2015
New Revision: 66862
URL:
http://svn.reactos.org/svn/reactos?rev=66862&view=rev
Log:
[SCHEDSVC]
Start work on the seceduler service.
[NETAPI32]
Implement the scheduler service client functions.
Added:
trunk/reactos/base/services/schedsvc/ (with props)
trunk/reactos/base/services/schedsvc/CMakeLists.txt (with props)
trunk/reactos/base/services/schedsvc/precomp.h (with props)
trunk/reactos/base/services/schedsvc/rpcserver.c (with props)
trunk/reactos/base/services/schedsvc/schedsvc.c (with props)
trunk/reactos/base/services/schedsvc/schedsvc.rc (with props)
trunk/reactos/base/services/schedsvc/schedsvc.spec (with props)
trunk/reactos/dll/win32/netapi32/schedule.c (with props)
trunk/reactos/include/reactos/idl/atsvc.acf (with props)
trunk/reactos/include/reactos/idl/atsvc.idl (with props)
Modified:
trunk/reactos/base/services/CMakeLists.txt
trunk/reactos/boot/bootdata/hivesft.inf
trunk/reactos/boot/bootdata/hivesys.inf
trunk/reactos/dll/win32/netapi32/CMakeLists.txt
trunk/reactos/dll/win32/netapi32/netapi32.c
trunk/reactos/dll/win32/netapi32/netapi32.spec
Modified: trunk/reactos/base/services/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/CMakeLists.t…
==============================================================================
--- trunk/reactos/base/services/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/base/services/CMakeLists.txt [iso-8859-1] Sun Mar 22 21:57:55 2015
@@ -2,6 +2,7 @@
add_subdirectory(audiosrv)
add_subdirectory(eventlog)
add_subdirectory(rpcss)
+add_subdirectory(schedsvc)
add_subdirectory(spoolsv)
add_subdirectory(svchost)
add_subdirectory(tcpsvcs)
Propchange: trunk/reactos/base/services/schedsvc/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Sun Mar 22 21:57:55 2015
@@ -0,0 +1 @@
+((CORE|ROSTESTS|ROSAPPS)-\d+)(,? ?((CORE|ROSTESTS|ROSAPPS)-\d+))*(,? ?(and |or
)?((CORE|ROSTESTS|ROSAPPS)-\d+))?
Propchange: trunk/reactos/base/services/schedsvc/
------------------------------------------------------------------------------
bugtraq:message = See issue %BUGID% for more details.
Propchange: trunk/reactos/base/services/schedsvc/
------------------------------------------------------------------------------
bugtraq:url =
https://jira.reactos.org/browse/%BUGID%
Propchange: trunk/reactos/base/services/schedsvc/
------------------------------------------------------------------------------
tsvn:logminsize = 10
Added: trunk/reactos/base/services/schedsvc/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/schedsvc/CMa…
==============================================================================
--- trunk/reactos/base/services/schedsvc/CMakeLists.txt (added)
+++ trunk/reactos/base/services/schedsvc/CMakeLists.txt [iso-8859-1] Sun Mar 22 21:57:55
2015
@@ -0,0 +1,16 @@
+
+include_directories(${REACTOS_SOURCE_DIR}/include/reactos/idl)
+add_rpc_files(server ${REACTOS_SOURCE_DIR}/include/reactos/idl/atsvc.idl)
+spec2def(schedsvc.dll schedsvc.spec ADD_IMPORTLIB)
+
+add_library(schedsvc SHARED
+ rpcserver.c
+ schedsvc.c
+ schedsvc.rc
+ ${CMAKE_CURRENT_BINARY_DIR}/atsvc_s.c
+ ${CMAKE_CURRENT_BINARY_DIR}/schedsvc.def)
+
+set_module_type(schedsvc win32dll UNICODE)
+target_link_libraries(schedsvc wine)
+add_importlibs(schedsvc advapi32 rpcrt4 msvcrt kernel32 ntdll)
+add_cd_file(TARGET schedsvc DESTINATION reactos/system32 FOR all)
Propchange: trunk/reactos/base/services/schedsvc/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/services/schedsvc/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/schedsvc/pre…
==============================================================================
--- trunk/reactos/base/services/schedsvc/precomp.h (added)
+++ trunk/reactos/base/services/schedsvc/precomp.h [iso-8859-1] Sun Mar 22 21:57:55 2015
@@ -0,0 +1,22 @@
+#ifndef _SCHEDSVC_PCH_
+#define _SCHEDSVC_PCH_
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+#include <stdarg.h>
+#include <windef.h>
+#include <winbase.h>
+#include <winreg.h>
+#include <winsvc.h>
+
+#include <atsvc_s.h>
+
+#include <wine/debug.h>
+
+DWORD
+WINAPI
+RpcThreadRoutine(
+ LPVOID lpParameter);
+
+#endif /* _SCHEDSVC_PCH_ */
Propchange: trunk/reactos/base/services/schedsvc/precomp.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/services/schedsvc/rpcserver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/schedsvc/rpc…
==============================================================================
--- trunk/reactos/base/services/schedsvc/rpcserver.c (added)
+++ trunk/reactos/base/services/schedsvc/rpcserver.c [iso-8859-1] Sun Mar 22 21:57:55
2015
@@ -0,0 +1,129 @@
+/*
+ * ReactOS Services
+ * Copyright (C) 2015 ReactOS Team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Services
+ * FILE: base/services/schedsvc/rpcserver.c
+ * PURPOSE: Scheduler service
+ * PROGRAMMER: Eric Kohl
+ */
+
+/* INCLUDES *****************************************************************/
+
+#include "precomp.h"
+
+#include "lmerr.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(schedsvc);
+
+/* FUNCTIONS *****************************************************************/
+
+DWORD
+WINAPI
+RpcThreadRoutine(
+ LPVOID lpParameter)
+{
+ RPC_STATUS Status;
+
+ Status = RpcServerUseProtseqEpW(L"ncacn_np", 20,
L"\\pipe\\atsvc", NULL);
+ if (Status != RPC_S_OK)
+ {
+ ERR("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status);
+ return 0;
+ }
+
+ Status = RpcServerRegisterIf(atsvc_v1_0_s_ifspec, NULL, NULL);
+ if (Status != RPC_S_OK)
+ {
+ ERR("RpcServerRegisterIf() failed (Status %lx)\n", Status);
+ return 0;
+ }
+
+ Status = RpcServerListen(1, RPC_C_LISTEN_MAX_CALLS_DEFAULT, FALSE);
+ if (Status != RPC_S_OK)
+ {
+ ERR("RpcServerListen() failed (Status %lx)\n", Status);
+ }
+
+ return 0;
+}
+
+
+void __RPC_FAR * __RPC_USER midl_user_allocate(SIZE_T len)
+{
+ return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
+}
+
+
+void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
+{
+ HeapFree(GetProcessHeap(), 0, ptr);
+}
+
+
+/* Function 0 */
+NET_API_STATUS
+WINAPI
+NetrJobAdd(
+ ATSVC_HANDLE ServerName,
+ LPAT_INFO pAtInfo,
+ LPDWORD pJobId)
+{
+ return ERROR_SUCCESS;
+}
+
+
+/* Function 1 */
+NET_API_STATUS
+WINAPI
+NetrJobDel(
+ ATSVC_HANDLE ServerName,
+ DWORD MinJobId,
+ DWORD MaxJobId)
+{
+ return ERROR_SUCCESS;
+}
+
+
+/* Function 2 */
+NET_API_STATUS
+__stdcall
+NetrJobEnum(
+ ATSVC_HANDLE ServerName,
+ LPAT_ENUM_CONTAINER pEnumContainer,
+ DWORD PreferedMaximumLength,
+ LPDWORD pTotalEntries,
+ LPDWORD pResumeHandle)
+{
+ return ERROR_SUCCESS;
+}
+
+
+/* Function 3 */
+NET_API_STATUS
+WINAPI
+NetrJobGetInfo(
+ ATSVC_HANDLE ServerName,
+ DWORD JobId,
+ LPAT_INFO *ppAtInfo)
+{
+ return ERROR_SUCCESS;
+}
+
+/* EOF */
Propchange: trunk/reactos/base/services/schedsvc/rpcserver.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/services/schedsvc/schedsvc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/schedsvc/sch…
==============================================================================
--- trunk/reactos/base/services/schedsvc/schedsvc.c (added)
+++ trunk/reactos/base/services/schedsvc/schedsvc.c [iso-8859-1] Sun Mar 22 21:57:55 2015
@@ -0,0 +1,183 @@
+/*
+ * ReactOS Services
+ * Copyright (C) 2015 ReactOS Team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Services
+ * FILE: base/services/schedsvc/schedsvc.c
+ * PURPOSE: Scheduling service
+ * PROGRAMMER: Eric Kohl
+ */
+
+/* INCLUDES *****************************************************************/
+
+#include "precomp.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(schedsvc);
+
+/* GLOBALS ******************************************************************/
+
+static WCHAR ServiceName[] = L"Schedule";
+
+static SERVICE_STATUS_HANDLE ServiceStatusHandle;
+static SERVICE_STATUS ServiceStatus;
+
+/* FUNCTIONS *****************************************************************/
+
+static VOID
+UpdateServiceStatus(DWORD dwState)
+{
+ ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
+ ServiceStatus.dwCurrentState = dwState;
+ ServiceStatus.dwControlsAccepted = 0;
+ ServiceStatus.dwWin32ExitCode = 0;
+ ServiceStatus.dwServiceSpecificExitCode = 0;
+ ServiceStatus.dwCheckPoint = 0;
+
+ if (dwState == SERVICE_START_PENDING ||
+ dwState == SERVICE_STOP_PENDING ||
+ dwState == SERVICE_PAUSE_PENDING ||
+ dwState == SERVICE_CONTINUE_PENDING)
+ ServiceStatus.dwWaitHint = 10000;
+ else
+ ServiceStatus.dwWaitHint = 0;
+
+ SetServiceStatus(ServiceStatusHandle,
+ &ServiceStatus);
+}
+
+static DWORD WINAPI
+ServiceControlHandler(DWORD dwControl,
+ DWORD dwEventType,
+ LPVOID lpEventData,
+ LPVOID lpContext)
+{
+ TRACE("ServiceControlHandler() called\n");
+
+ switch (dwControl)
+ {
+ case SERVICE_CONTROL_STOP:
+ TRACE(" SERVICE_CONTROL_STOP received\n");
+ /* Stop listening to incoming RPC messages */
+ RpcMgmtStopServerListening(NULL);
+ UpdateServiceStatus(SERVICE_STOPPED);
+ return ERROR_SUCCESS;
+
+ case SERVICE_CONTROL_PAUSE:
+ TRACE(" SERVICE_CONTROL_PAUSE received\n");
+ UpdateServiceStatus(SERVICE_PAUSED);
+ return ERROR_SUCCESS;
+
+ case SERVICE_CONTROL_CONTINUE:
+ TRACE(" SERVICE_CONTROL_CONTINUE received\n");
+ UpdateServiceStatus(SERVICE_RUNNING);
+ return ERROR_SUCCESS;
+
+ case SERVICE_CONTROL_INTERROGATE:
+ TRACE(" SERVICE_CONTROL_INTERROGATE received\n");
+ SetServiceStatus(ServiceStatusHandle,
+ &ServiceStatus);
+ return ERROR_SUCCESS;
+
+ case SERVICE_CONTROL_SHUTDOWN:
+ TRACE(" SERVICE_CONTROL_SHUTDOWN received\n");
+ UpdateServiceStatus(SERVICE_STOPPED);
+ return ERROR_SUCCESS;
+
+ default :
+ TRACE(" Control %lu received\n", dwControl);
+ return ERROR_CALL_NOT_IMPLEMENTED;
+ }
+}
+
+
+static
+DWORD
+ServiceInit(VOID)
+{
+ HANDLE hThread;
+
+ hThread = CreateThread(NULL,
+ 0,
+ (LPTHREAD_START_ROUTINE)RpcThreadRoutine,
+ NULL,
+ 0,
+ NULL);
+
+ if (!hThread)
+ {
+ ERR("Can't create PortThread\n");
+ return GetLastError();
+ }
+ else
+ CloseHandle(hThread);
+
+ return ERROR_SUCCESS;
+}
+
+
+VOID WINAPI
+SchedServiceMain(DWORD argc, LPTSTR *argv)
+{
+ DWORD dwError;
+
+ UNREFERENCED_PARAMETER(argc);
+ UNREFERENCED_PARAMETER(argv);
+
+ TRACE("SchedServiceMain() called\n");
+
+ ServiceStatusHandle = RegisterServiceCtrlHandlerExW(ServiceName,
+ ServiceControlHandler,
+ NULL);
+ if (!ServiceStatusHandle)
+ {
+ ERR("RegisterServiceCtrlHandlerExW() failed! (Error %lu)\n",
GetLastError());
+ return;
+ }
+
+ UpdateServiceStatus(SERVICE_START_PENDING);
+
+ dwError = ServiceInit();
+ if (dwError != ERROR_SUCCESS)
+ {
+ ERR("Service stopped (dwError: %lu\n", dwError);
+ UpdateServiceStatus(SERVICE_STOPPED);
+ return;
+ }
+
+ UpdateServiceStatus(SERVICE_RUNNING);
+}
+
+
+BOOL WINAPI
+DllMain(HINSTANCE hinstDLL,
+ DWORD fdwReason,
+ LPVOID lpvReserved)
+{
+ switch (fdwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ DisableThreadLibraryCalls(hinstDLL);
+ break;
+
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+
+ return TRUE;
+}
Propchange: trunk/reactos/base/services/schedsvc/schedsvc.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/services/schedsvc/schedsvc.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/schedsvc/sch…
==============================================================================
--- trunk/reactos/base/services/schedsvc/schedsvc.rc (added)
+++ trunk/reactos/base/services/schedsvc/schedsvc.rc [iso-8859-1] Sun Mar 22 21:57:55
2015
@@ -0,0 +1,5 @@
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION "Scheduler Service"
+#define REACTOS_STR_INTERNAL_NAME "schedsvc"
+#define REACTOS_STR_ORIGINAL_FILENAME "schedsvc.dll"
+#include <reactos/version.rc>
Propchange: trunk/reactos/base/services/schedsvc/schedsvc.rc
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/services/schedsvc/schedsvc.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/schedsvc/sch…
==============================================================================
--- trunk/reactos/base/services/schedsvc/schedsvc.spec (added)
+++ trunk/reactos/base/services/schedsvc/schedsvc.spec [iso-8859-1] Sun Mar 22 21:57:55
2015
@@ -0,0 +1 @@
+@ stdcall SchedServiceMain(long ptr)
Propchange: trunk/reactos/base/services/schedsvc/schedsvc.spec
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/boot/bootdata/hivesft.inf
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesft.inf?…
==============================================================================
--- trunk/reactos/boot/bootdata/hivesft.inf [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/hivesft.inf [iso-8859-1] Sun Mar 22 21:57:55 2015
@@ -1609,7 +1609,7 @@
; SvcHost services
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost",,0x00000012
HKLM,"SOFTWARE\Microsoft\Windows
NT\CurrentVersion\SvcHost","DcomLaunch",0x00010000,"PlugPlay"
-HKLM,"SOFTWARE\Microsoft\Windows
NT\CurrentVersion\SvcHost","netsvcs",0x00010000,"DHCP","BITS","lanmanworkstation","winmgmt"
+HKLM,"SOFTWARE\Microsoft\Windows
NT\CurrentVersion\SvcHost","netsvcs",0x00010000,"DHCP","BITS","lanmanworkstation","Schedule","winmgmt"
; Win32 config
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows",,0x00000012
Modified: trunk/reactos/boot/bootdata/hivesys.inf
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys.inf?…
==============================================================================
--- trunk/reactos/boot/bootdata/hivesys.inf [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/hivesys.inf [iso-8859-1] Sun Mar 22 21:57:55 2015
@@ -1252,6 +1252,7 @@
"PNP_TDI", \
"TDI", \
"PlugPlay", \
+ "SchedulerGroup", \
"SpoolerGroup", \
"UIGroup", \
"Extended Base"
@@ -1897,6 +1898,18 @@
HKLM,"SYSTEM\CurrentControlSet\Services\Rpcss","Start",0x00010001,0x00000002
HKLM,"SYSTEM\CurrentControlSet\Services\Rpcss","Type",0x00010001,0x00000010
+; Scheduler service
+HKLM,"SYSTEM\CurrentControlSet\Services\Schedule","DependOnService",0x00010000,"RPCSS"
+HKLM,"SYSTEM\CurrentControlSet\Services\Schedule","DisplayName",0x00000000,"Scheduler
service"
+HKLM,"SYSTEM\CurrentControlSet\Services\Schedule","ErrorControl",0x00010001,0x00000001
+HKLM,"SYSTEM\CurrentControlSet\Services\Schedule","Group",0x00000000,"SchedulerGroup"
+HKLM,"SYSTEM\CurrentControlSet\Services\Schedule","ImagePath",0x00020000,"%SystemRoot%\system32\svchost.exe
-k netsvcs"
+HKLM,"SYSTEM\CurrentControlSet\Services\Schedule","ObjectName",0x00000000,"LocalSystem"
+HKLM,"SYSTEM\CurrentControlSet\Services\Schedule","Start",0x00010001,0x00000002
+HKLM,"SYSTEM\CurrentControlSet\Services\Schedule","Type",0x00010001,0x00000020
+HKLM,"SYSTEM\CurrentControlSet\Services\Schedule\Parameters","ServiceDll",0x00020000,"%SystemRoot%\system32\schedsvc.dll"
+HKLM,"SYSTEM\CurrentControlSet\Services\Schedule\Parameters","ServiceMain",0x00000000,"SchedServiceMain"
+
; Spooler service
HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","DependOnService",0x00010000,"RPCSS"
HKLM,"SYSTEM\CurrentControlSet\Services\Spooler","DisplayName",0x00000000,"Printer
Spooler"
Modified: trunk/reactos/dll/win32/netapi32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/CMakeLi…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/CMakeLists.txt [iso-8859-1] Sun Mar 22 21:57:55 2015
@@ -6,6 +6,7 @@
add_definitions(-D__WINESRC__)
spec2def(netapi32.dll netapi32.spec ADD_IMPORTLIB)
add_rpc_files(client
+ ${REACTOS_SOURCE_DIR}/include/reactos/idl/atsvc.idl
${REACTOS_SOURCE_DIR}/include/reactos/idl/dssetup.idl
${REACTOS_SOURCE_DIR}/include/reactos/idl/wkssvc.idl)
@@ -23,11 +24,13 @@
nbt.c
netapi32.c
netbios.c
+ schedule.c
share.c
user.c
wksta.c
wksta_new.c
netapi32.h
+ ${CMAKE_CURRENT_BINARY_DIR}/atsvc_c.c
${CMAKE_CURRENT_BINARY_DIR}/dssetup_c.c
${CMAKE_CURRENT_BINARY_DIR}/wkssvc_c.c)
Modified: trunk/reactos/dll/win32/netapi32/netapi32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netapi3…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/netapi32.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/netapi32.c [iso-8859-1] Sun Mar 22 21:57:55 2015
@@ -201,25 +201,3 @@
return ApiStatus;
}
-
-NET_API_STATUS WINAPI NetScheduleJobAdd(LPCWSTR server, LPBYTE bufptr, LPDWORD jobid)
-{
- FIXME("stub (%s, %p, %p)\n", debugstr_w(server), bufptr, jobid);
- return NERR_Success;
-}
-
-NET_API_STATUS WINAPI NetScheduleJobDel(LPCWSTR server, DWORD minjobid, DWORD maxjobid)
-{
- FIXME("stub (%s, %d, %d)\n", debugstr_w(server), minjobid, maxjobid);
- return NERR_Success;
-}
-
-NET_API_STATUS WINAPI NetScheduleJobEnum(LPCWSTR server, LPBYTE* bufptr, DWORD
prefmaxsize, LPDWORD entriesread,
- LPDWORD totalentries, LPDWORD resumehandle)
-{
- FIXME("stub (%s, %p, %d, %p, %p, %p)\n", debugstr_w(server), bufptr,
prefmaxsize, entriesread, totalentries, resumehandle);
- *entriesread = 0;
- *totalentries = 0;
- return NERR_Success;
-}
-
Modified: trunk/reactos/dll/win32/netapi32/netapi32.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netapi3…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] Sun Mar 22 21:57:55 2015
@@ -204,7 +204,7 @@
@ stdcall NetScheduleJobAdd(wstr ptr ptr)
@ stdcall NetScheduleJobDel(wstr long long)
@ stdcall NetScheduleJobEnum(wstr ptr long ptr ptr ptr)
-@ stub NetScheduleJobGetInfo
+@ stdcall NetScheduleJobGetInfo(wstr long ptr)
@ stub NetServerComputerNameAdd
@ stub NetServerComputerNameDel
@ stdcall NetServerDiskEnum(wstr long ptr long ptr ptr ptr)
Added: trunk/reactos/dll/win32/netapi32/schedule.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/schedul…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/schedule.c (added)
+++ trunk/reactos/dll/win32/netapi32/schedule.c [iso-8859-1] Sun Mar 22 21:57:55 2015
@@ -0,0 +1,199 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: NetAPI DLL
+ * FILE: reactos/dll/win32/netapi32/schedule.c
+ * PURPOSE: Scheduler service interface code
+ *
+ * PROGRAMMERS: Eric Kohl
+ */
+
+/* INCLUDES ******************************************************************/
+
+#include "netapi32.h"
+#include "atsvc_c.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(netapi32);
+
+/* FUNCTIONS *****************************************************************/
+
+handle_t __RPC_USER
+ATSVC_HANDLE_bind(ATSVC_HANDLE pszSystemName)
+{
+ handle_t hBinding = NULL;
+ LPWSTR pszStringBinding;
+ RPC_STATUS status;
+
+ TRACE("ATSVC_HANDLE_bind() called\n");
+
+ status = RpcStringBindingComposeW(NULL,
+ L"ncacn_np",
+ (RPC_WSTR)pszSystemName,
+ L"\\pipe\\atsvc",
+ NULL,
+ &pszStringBinding);
+ if (status)
+ {
+ TRACE("RpcStringBindingCompose returned 0x%x\n", status);
+ return NULL;
+ }
+
+ /* Set the binding handle that will be used to bind to the server. */
+ status = RpcBindingFromStringBindingW(pszStringBinding,
+ &hBinding);
+ if (status)
+ {
+ TRACE("RpcBindingFromStringBinding returned 0x%x\n", status);
+ }
+
+ status = RpcStringFreeW(&pszStringBinding);
+ if (status)
+ {
+// TRACE("RpcStringFree returned 0x%x\n", status);
+ }
+
+ return hBinding;
+}
+
+
+void __RPC_USER
+ATSVC_HANDLE_unbind(ATSVC_HANDLE pszSystemName,
+ handle_t hBinding)
+{
+ RPC_STATUS status;
+
+ TRACE("ATSVC_HANDLE_unbind() called\n");
+
+ status = RpcBindingFree(&hBinding);
+ if (status)
+ {
+ TRACE("RpcBindingFree returned 0x%x\n", status);
+ }
+}
+
+
+NET_API_STATUS
+WINAPI
+NetScheduleJobAdd(
+ LPCWSTR ServerName,
+ LPBYTE Buffer,
+ LPDWORD JobId)
+{
+ NET_API_STATUS status;
+
+ TRACE("NetScheduleJobAdd(%s, %p, %p)\n", debugstr_w(ServerName),
+ Buffer, JobId);
+
+ RpcTryExcept
+ {
+ status = NetrJobAdd(ServerName,
+ (LPAT_INFO)Buffer,
+ JobId);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
+NetScheduleJobDel(
+ LPCWSTR ServerName,
+ DWORD MinJobId,
+ DWORD MaxJobId)
+{
+ NET_API_STATUS status;
+
+ TRACE("NetScheduleJobDel(%s, %d, %d)\n", debugstr_w(ServerName),
+ MinJobId, MaxJobId);
+
+ RpcTryExcept
+ {
+ status = NetrJobDel(ServerName,
+ MinJobId,
+ MaxJobId);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
+NetScheduleJobEnum(
+ LPCWSTR ServerName,
+ LPBYTE *PointerToBuffer,
+ DWORD PreferredMaximumLength,
+ LPDWORD EntriesRead,
+ LPDWORD TotalEntries,
+ LPDWORD ResumeHandle)
+{
+ AT_ENUM_CONTAINER EnumContainer;
+ NET_API_STATUS status;
+
+ TRACE("NetScheduleJobEnum(%s, %p, %d, %p, %p, %p)\n",
debugstr_w(ServerName),
+ PointerToBuffer, PreferredMaximumLength, EntriesRead, TotalEntries,
ResumeHandle);
+
+ EnumContainer.EntriesRead = 0;
+ EnumContainer.Buffer = NULL;
+
+ RpcTryExcept
+ {
+ status = NetrJobEnum(ServerName,
+ &EnumContainer,
+ PreferredMaximumLength,
+ TotalEntries,
+ ResumeHandle);
+ if (status == NERR_Success || status == ERROR_MORE_DATA)
+ {
+ *PointerToBuffer = (LPBYTE)EnumContainer.Buffer;
+ *EntriesRead = EnumContainer.EntriesRead;
+ }
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
+NetScheduleJobGetInfo(
+ LPCWSTR ServerName,
+ DWORD JobId,
+ LPBYTE *PointerToBuffer)
+{
+ NET_API_STATUS status;
+
+ TRACE("NetScheduleJobGetInfo(%s, %d, %p)\n", debugstr_w(ServerName),
+ JobId, PointerToBuffer);
+
+ RpcTryExcept
+ {
+ status = NetrJobGetInfo(ServerName,
+ JobId,
+ (LPAT_INFO *)PointerToBuffer);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+/* EOF */
Propchange: trunk/reactos/dll/win32/netapi32/schedule.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/include/reactos/idl/atsvc.acf
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/idl/atsvc.…
==============================================================================
--- trunk/reactos/include/reactos/idl/atsvc.acf (added)
+++ trunk/reactos/include/reactos/idl/atsvc.acf [iso-8859-1] Sun Mar 22 21:57:55 2015
@@ -0,0 +1,6 @@
+[
+ explicit_handle
+]
+interface atsvc
+{
+}
Propchange: trunk/reactos/include/reactos/idl/atsvc.acf
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/include/reactos/idl/atsvc.idl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/idl/atsvc.…
==============================================================================
--- trunk/reactos/include/reactos/idl/atsvc.idl (added)
+++ trunk/reactos/include/reactos/idl/atsvc.idl [iso-8859-1] Sun Mar 22 21:57:55 2015
@@ -0,0 +1,81 @@
+/*
+ * Scheduler Service interface definition
+ */
+
+#include <ms-dtyp.idl>
+
+typedef [handle] const wchar_t *ATSVC_HANDLE;
+
+typedef struct _AT_ENUM
+{
+ DWORD JobId;
+ DWORD_PTR JobTime;
+ DWORD DaysOfMonth;
+ unsigned char DaysOfWeek;
+ unsigned char Flags;
+ wchar_t *Command;
+} AT_ENUM, *PAT_ENUM, *LPAT_ENUM;
+
+typedef struct _AT_INFO
+{
+ DWORD_PTR JobTime;
+ DWORD DaysOfMonth;
+ unsigned char DaysOfWeek;
+ unsigned char Flags;
+ [string] wchar_t *Command;
+} AT_INFO, *PAT_INFO, *LPAT_INFO;
+
+typedef struct _AT_ENUM_CONTAINER
+{
+ DWORD EntriesRead;
+ [size_is( EntriesRead)] LPAT_ENUM Buffer;
+} AT_ENUM_CONTAINER, *PAT_ENUM_CONTAINER, *LPAT_ENUM_CONTAINER;
+
+[
+ uuid(1FF70682-0A51-30E8-076D-740BE8CEE98B),
+ version(1.0),
+#ifdef __midl
+ ms_union,
+#endif
+ pointer_default(unique),
+ endpoint("ncacn_np:[\\pipe\\atsvc]")
+#ifndef __midl
+ ,explicit_handle
+#endif
+]
+interface atsvc
+{
+ /* Function 0 */
+ NET_API_STATUS
+ __stdcall
+ NetrJobAdd(
+ [in, string, unique] ATSVC_HANDLE ServerName,
+ [in] LPAT_INFO pAtInfo,
+ [out] LPDWORD pJobId);
+
+ /* Function 1 */
+ NET_API_STATUS
+ __stdcall
+ NetrJobDel(
+ [in, string, unique] ATSVC_HANDLE ServerName,
+ [in] DWORD MinJobId,
+ [in] DWORD MaxJobId);
+
+ /* Function 2 */
+ NET_API_STATUS
+ __stdcall
+ NetrJobEnum(
+ [in, string, unique] ATSVC_HANDLE ServerName,
+ [in,out] LPAT_ENUM_CONTAINER pEnumContainer,
+ [in] DWORD PreferedMaximumLength,
+ [out] LPDWORD pTotalEntries,
+ [in, out, unique] LPDWORD pResumeHandle);
+
+ /* Function 3 */
+ NET_API_STATUS
+ __stdcall
+ NetrJobGetInfo(
+ [in, string, unique] ATSVC_HANDLE ServerName,
+ [in] DWORD JobId,
+ [out] LPAT_INFO *ppAtInfo);
+}
Propchange: trunk/reactos/include/reactos/idl/atsvc.idl
------------------------------------------------------------------------------
svn:eol-style = native