Skip to content

Commit

Permalink
Enabling and solving taskschd
Browse files Browse the repository at this point in the history
  • Loading branch information
Skulltrail192 committed Jun 7, 2021
1 parent 3f875a8 commit 22623e2
Show file tree
Hide file tree
Showing 10 changed files with 325 additions and 185 deletions.
1 change: 1 addition & 0 deletions sdk/include/reactos/wine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ add_idl_headers(wineheaders
mfmediaengine.idl
mfplay.idl
mfreadwrite.idl
schrpc.idl
)
101 changes: 101 additions & 0 deletions sdk/include/reactos/wine/schrpc.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
* Task Scheduler Service definitions
*
* Copyright 2014 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/

cpp_quote("#define SCHEDSVC_TRANSPORT {'n','c','a','l','r','p','c',0}")
cpp_quote("#define SCH_FLAG_STATE 0x10000000")

import "oaidl.idl";
import "ocidl.idl";

[
uuid(86d35949-83c9-4044-b424-db363231fd0c),
implicit_handle(handle_t schrpc_handle),
version(1.0),
pointer_default(unique)
]
interface ITaskSchedulerService
{
typedef struct _TASK_USER_CRED
{
[string] const WCHAR *user;
[string] const WCHAR *password;
DWORD flags;
} TASK_USER_CRED;

typedef struct _TASK_XML_ERROR_INFO
{
DWORD line, column;
[string] WCHAR *node;
[string] WCHAR *value;
} TASK_XML_ERROR_INFO;

typedef [string] WCHAR **TASK_NAMES;

HRESULT SchRpcHighestVersion([out] DWORD *version);
HRESULT SchRpcRegisterTask([in, string, unique] const WCHAR *path,
[in, string] const WCHAR *xml, [in] DWORD flags,
[in, string, unique] const WCHAR *sddl,
[in] DWORD task_logon_type, [in] DWORD n_creds,
[in, size_is(n_creds), unique] const TASK_USER_CRED *creds,
[out, string] WCHAR **actual_path,
[out] TASK_XML_ERROR_INFO **xml_error_info);
HRESULT SchRpcRetrieveTask([in, string] const WCHAR *path,
[in, string] const WCHAR *languages,
[in] unsigned long *n_languages, [out, string] WCHAR **xml);
HRESULT SchRpcCreateFolder([in, string] const WCHAR *path,
[in, string, unique] const WCHAR *sddl, [in] DWORD flags);
HRESULT SchRpcSetSecurity([in, string] const WCHAR *path,
[in, string] const WCHAR *sddl, [in] DWORD flags);
HRESULT SchRpcGetSecurity([in, string] const WCHAR *path,
[in] DWORD flags, [out, string] WCHAR **sddl);
HRESULT SchRpcEnumFolders([in, string] const WCHAR *path,
[in] DWORD flags, [in, out] DWORD *start_index,
[in] DWORD n_requested, [out] DWORD *n_names,
[out, string, size_is(,*n_names)] TASK_NAMES *names);
HRESULT SchRpcEnumTasks([in, string] const WCHAR *path,
[in] DWORD flags, [in, out] DWORD *start_index,
[in] DWORD n_requested, [out] DWORD *n_names,
[out, string, size_is(,*n_names)] TASK_NAMES *names);
HRESULT SchRpcEnumInstances([in, string, unique] const WCHAR *path,
[in] DWORD flags, [out] DWORD *n_guids,
[out, size_is(,*n_guids)] GUID **guids);
HRESULT SchRpcGetInstanceInfo([in] GUID guid, [out, string] WCHAR **path,
[out] DWORD *task_state, [out, string] WCHAR **action,
[out, string] WCHAR **info, [out] DWORD *n_instances,
[out, size_is(,*n_instances)] GUID **instances, [out] DWORD *pid);
HRESULT SchRpcStopInstance([in] GUID guid, [in] DWORD flags);
HRESULT SchRpcStop([in, string, unique] const WCHAR *path, [in] DWORD flags);
HRESULT SchRpcRun([in, string] const WCHAR *path,
[in] DWORD n_args, [in, size_is(n_args),unique] const WCHAR **args,
[in] DWORD flags, [in] DWORD session_id,
[in, unique, string] const WCHAR *user, [out] GUID *guid);
HRESULT SchRpcDelete([in, string] const WCHAR *path, [in] DWORD flags);
HRESULT SchRpcRename([in, string] const WCHAR *path, [in, string] const WCHAR *name, [in] DWORD flags);
HRESULT SchRpcScheduledRuntimes([in, string] const WCHAR *path,
[in, unique] SYSTEMTIME *start, [in, unique] SYSTEMTIME *end,
[in] DWORD flags, [in] DWORD n_requested, [out] DWORD *n_runtimes,
[out, size_is(,*n_runtimes)] SYSTEMTIME **runtimes);
HRESULT SchRpcGetLastRunInfo([in, string] const WCHAR *path,
[out] SYSTEMTIME *last_runtime, [out] DWORD *last_return_code);
HRESULT SchRpcGetTaskInfo([in, string] const WCHAR *path, [in] DWORD flags,
[out] DWORD *enabled, [out] DWORD *task_state);
HRESULT SchRpcGetNumberOfMissedRuns([in, string] const WCHAR *path, [out] DWORD *runs);
HRESULT SchRpcEnableTask([in, string] const WCHAR *path, [in] DWORD enabled);
}
185 changes: 2 additions & 183 deletions wrappers/includes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,192 +4,11 @@ add_definitions(-D_MIDL_USE_GUIDDEF_)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

list(APPEND SOURCE
# control.idl
# cor.idl
# cordebug.idl
# # crtrow.idl
# ctxtcall.idl
# d2d1.idl
# d2d1_1.idl
# d2d1_2.idl
# d3dcommon.idl
# d3d10.idl
# d3d10_1.idl
# d3d10sdklayers.idl
# d3d11.idl
# d3d11_1.idl
# d3d11_2.idl
# d3d11_3.idl
# d3d11_4.idl
# d3d11sdklayers.idl
# dxgicommon.idl
# dxgiformat.idl
# dxgitype.idl
# dxgi.idl
# dxgi1_2.idl
# dxgi1_3.idl
# dxgi1_4.idl
# dxgi1_5.idl
# dxgi1_6.idl
dxva2api.idl
# d3dx10core.idl
# d3dx11core.idl
# dcommon.idl
# dwrite.idl
# dwrite_1.idl
# dwrite_2.idl
# dwrite_3.idl
# dbccmd.idl
# dbcses.idl
# dbdsad.idl
# dbinit.idl
# dbprop.idl
# dbs.idl
# devenum.idl
# devicetopology.idl
# dimm.idl
# dispex.idl
# docobj.idl
# docobjectservice.idl
# downloadmgr.idl
# # dyngraph.idl
# endpointvolume.idl
#evr.idl
dxva2api.idl
evr9.idl
# exdisp.idl
# fusion.idl
# hlink.idl
# htiface.idl
# htiframe.idl
# httprequest.idl
# hstring.idl
# gameux.idl
# iads.idl
# icftypes.idl
# imnact.idl
# imnxport.idl
# indexsrv.idl
# inputscope.idl
# inseng.idl
# inspectable.idl
# metahost.idl
mfidl.idl
mftransform.idl
# mimeinfo.idl
# mimeole.idl
# mlang.idl
# mmdeviceapi.idl
# mscoree.idl
# msctf.idl
# msdadc.idl
# mshtmhst.idl
# mshtml.idl
# msinkaut.idl
# mstask.idl
# msxml.idl
# msxml2.idl
# msxml6.idl
# netcon.idl
# netfw.idl
# oaidl.idl
# objectarray.idl
# objidl.idl
# objsafe.idl
# ocidl.idl
# ocmm.idl
# oleacc.idl
# oledb.idl
# oleidl.idl
# # opnrst.idl
# optary.idl
# perhist.idl
# propidl.idl
# propsys.idl
# pstore.idl
# richole.idl
# roparameterizediid.idl
# # row.idl
# # rowchg.idl
# # rstbas.idl
# # rstinf.idl
# # rstloc.idl
# sensevts.idl
# servprov.idl
# # sesprp.idl
# shdeprecated.idl
# shldisp.idl
# shobjidl.idl
# shtypes.idl
# # stdole2.idl
# strmif.idl
# structuredquerycondition.idl
# textstor.idl
# tlogstg.idl
# tom.idl
# tuner.idl
# uiautomationclient.idl
# uiautomationcore.idl
# unknwn.idl
# urlhist.idl
# urlmon.idl
# vmr9.idl
# # vmrender.idl
# vss.idl
# wbemcli.idl
# wbemdisp.idl
# wbemprov.idl
# wia_lh.idl
# wia_xp.idl
# wincodec.idl
# wincodecsdk.idl
# winsxs.idl
# wmiutils.idl
# wmsbuffer.idl
# wmsdkidl.idl
# wpcapi.idl
# wtypes.idl
# wuapi.idl
# xmldom.idl
# xmldso.idl
# ctfutb.idl
# xmllite.idl
# dxgi_internal.idl
)

add_idl_headers(wsdk ${SOURCE})
add_dependencies(wsdk xdk)
# add_typelib(stdole2.idl)
# add_custom_target(stdole2 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/stdole2.tlb)

# add_idl_headers(d3d_idl_headers d3dcommon.idl
# d2d1.idl
# d2d1_1.idl
# d2d1_2.idl
# d3d10.idl
# d3d10_1.idl
# d3d10sdklayers.idl
# d3d11.idl
# d3d11_1.idl
# d3d11_2.idl
# d3d12.idl
# d3d11sdklayers.idl
# dxgi.idl
# dxgi1_2.idl
# dwrite.idl
# dwrite_1.idl
# dwrite_2.idl
# dwrite_3.idl)

# add_iid_library(dxgi_uuids dxgi.idl dxgi1_2.idl dxgi1_3.idl dxgi1_4.idl dxgi1_5.idl dxgi1_6.idl d3d12.idl dxgi_internal.idl)
# add_iid_library(d2d1_uuids d2d1.idl d2d1_1.idl d2d1_2.idl)
# add_iid_library(d3d10_uuids d3d10.idl d3d10_1.idl d3d10sdklayers.idl)
# add_iid_library(d3d10_1_uuids d3d10_1.idl)
# add_iid_library(d3d11_uuids d3d11.idl d3d11_1.idl d3d11_2.idl d3d11sdklayers.idl)
# add_iid_library(dwrite_uuids dwrite.idl dwrite_1.idl dwrite_2.idl dwrite_3.idl)

# add_iid_library(wuguid wuapi.idl)
# add_iid_library(xml_uuids msxml2.idl)

# add_iid_library(activation_uuids activation.idl)

# generate_idl_iids(wincodec.idl)
add_dependencies(wsdk xdk)
2 changes: 1 addition & 1 deletion wrappers/new-dlls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_subdirectory(sas)
add_subdirectory(secbase)
add_subdirectory(shcore)
add_subdirectory(sspicli)
#add_subdirectory(taskschd)
add_subdirectory(taskschd)
#add_subdirectory(tdh)
add_subdirectory(uiautomationcore)
#add_subdirectory(uiribbon)
Expand Down
31 changes: 31 additions & 0 deletions wrappers/new-dlls/taskschd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

add_definitions(-D__WINESRC__)
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x600)
include_directories(${REACTOS_BINARY_DIR}/sdk/include/psdk)
include_directories(${REACTOS_BINARY_DIR}/sdk/include/reactos/wine)
include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
spec2def(taskschd.dll taskschd.spec)

add_idl_headers(taskschd_idlheader schrpc.idl taskschd_tlb.idl)
add_rpc_files(client schrpc.idl)

list(APPEND SOURCE
folder.c
folder_collection.c
main.c
regtask.c
task.c
taskschd.c
version.rc
${CMAKE_CURRENT_BINARY_DIR}/taskschd_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/taskschd.def
${CMAKE_CURRENT_BINARY_DIR}/schrpc_c.c)

add_library(taskschd SHARED ${SOURCE})
add_dependencies(taskschd mf_idlheader)
set_module_type(taskschd win32dll)
target_link_libraries(taskschd wine uuid mfuuid)
add_importlibs(taskschd oleaut32 ole32 advapi32 xmllite rpcrt4 msvcrt kernelbase ntdll)

add_cd_file(TARGET taskschd DESTINATION reactos/system32 FOR all)
Loading

0 comments on commit 22623e2

Please sign in to comment.