Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/mstask/Makefile.in | 3 ++- dlls/mstask/atsvc.idl | 21 +++++++++++++++++++++ dlls/mstask/mstask.spec | 16 ++++++++-------- dlls/mstask/mstask_main.c | 30 ++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 9 deletions(-) create mode 100644 dlls/mstask/atsvc.idl
diff --git a/dlls/mstask/Makefile.in b/dlls/mstask/Makefile.in index d914666eed..086d3c0c5a 100644 --- a/dlls/mstask/Makefile.in +++ b/dlls/mstask/Makefile.in @@ -1,5 +1,5 @@ MODULE = mstask.dll -IMPORTS = ole32 oleaut32 +IMPORTS = rpcrt4 ole32 oleaut32
C_SRCS = \ factory.c \ @@ -9,4 +9,5 @@ C_SRCS = \ task_trigger.c
IDL_SRCS = \ + atsvc.idl \ mstask_local.idl diff --git a/dlls/mstask/atsvc.idl b/dlls/mstask/atsvc.idl new file mode 100644 index 0000000000..b5a2cee0e9 --- /dev/null +++ b/dlls/mstask/atsvc.idl @@ -0,0 +1,21 @@ +/* + * Copyright 2018 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 + */ + +#pragma makedep client + +#include "wine/atsvc.idl" diff --git a/dlls/mstask/mstask.spec b/dlls/mstask/mstask.spec index 0b6c23b79d..dcfb20cab3 100644 --- a/dlls/mstask/mstask.spec +++ b/dlls/mstask/mstask.spec @@ -2,10 +2,10 @@ @ stdcall -private DllCanUnloadNow() @ stdcall -private DllGetClassObject(ptr ptr ptr) @ stub GetNetScheduleAccountInformation -@ stub NetrJobAdd -@ stub NetrJobDel -@ stub NetrJobEnum -@ stub NetrJobGetInfo +@ stdcall NetrJobAdd(wstr ptr ptr) +@ stdcall NetrJobDel(wstr long long) +@ stdcall NetrJobEnum(wstr ptr long ptr ptr) +@ stdcall NetrJobGetInfo(wstr long ptr) @ stub SAGetAccountInformation @ stub SAGetNSAccountInformation @ stub SASetAccountInformation @@ -15,10 +15,10 @@ @ stub _DllCanUnloadNow@0 @ stub _DllGetClassObject@12 @ stub _GetNetScheduleAccountInformation@12 -@ stub _NetrJobAdd@12 -@ stub _NetrJobDel@12 -@ stub _NetrJobEnum@20 -@ stub _NetrJobGetInfo@12 +@ stdcall _NetrJobAdd@12(wstr ptr ptr) NetrJobAdd +@ stdcall _NetrJobDel@12(wstr long long) NetrJobDel +@ stdcall _NetrJobEnum@20(wstr ptr long ptr ptr) NetrJobEnum +@ stdcall _NetrJobGetInfo@12(wstr long ptr) NetrJobGetInfo @ stub _SAGetAccountInformation@16 @ stub _SAGetNSAccountInformation@12 @ stub _SASetAccountInformation@20 diff --git a/dlls/mstask/mstask_main.c b/dlls/mstask/mstask_main.c index eae85562f5..c1e9036819 100644 --- a/dlls/mstask/mstask_main.c +++ b/dlls/mstask/mstask_main.c @@ -27,6 +27,7 @@ #include "taskschd.h" #include "mstask.h" #include "mstask_private.h" +#include "atsvc.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(mstask); @@ -77,3 +78,32 @@ HRESULT WINAPI DllUnregisterServer(void) { return __wine_unregister_resources( hInst ); } + +DECLSPEC_HIDDEN void __RPC_FAR *__RPC_USER MIDL_user_allocate(SIZE_T n) +{ + return HeapAlloc(GetProcessHeap(), 0, n); +} + +DECLSPEC_HIDDEN void __RPC_USER MIDL_user_free(void __RPC_FAR *p) +{ + HeapFree(GetProcessHeap(), 0, p); +} + +DECLSPEC_HIDDEN handle_t __RPC_USER ATSVC_HANDLE_bind(ATSVC_HANDLE str) +{ + static unsigned char ncalrpc[] = "ncalrpc"; + unsigned char *binding_str; + handle_t rpc_handle = 0; + + if (RpcStringBindingComposeA(NULL, ncalrpc, NULL, NULL, NULL, &binding_str) == RPC_S_OK) + { + RpcBindingFromStringBindingA(binding_str, &rpc_handle); + RpcStringFreeA(&binding_str); + } + return rpc_handle; +} + +DECLSPEC_HIDDEN void __RPC_USER ATSVC_HANDLE_unbind(ATSVC_HANDLE ServerName, handle_t rpc_handle) +{ + RpcBindingFree(&rpc_handle); +}
Dmitry Timoshkov dmitry@baikal.ru writes:
@@ -2,10 +2,10 @@ @ stdcall -private DllCanUnloadNow() @ stdcall -private DllGetClassObject(ptr ptr ptr) @ stub GetNetScheduleAccountInformation -@ stub NetrJobAdd -@ stub NetrJobDel -@ stub NetrJobEnum -@ stub NetrJobGetInfo +@ stdcall NetrJobAdd(wstr ptr ptr) +@ stdcall NetrJobDel(wstr long long) +@ stdcall NetrJobEnum(wstr ptr long ptr ptr) +@ stdcall NetrJobGetInfo(wstr long ptr)
Sorry for not catching this before committing, but the calling convention of the RPC interface is cdecl, so this won't work.
Alexandre Julliard julliard@winehq.org wrote:
@@ -2,10 +2,10 @@ @ stdcall -private DllCanUnloadNow() @ stdcall -private DllGetClassObject(ptr ptr ptr) @ stub GetNetScheduleAccountInformation -@ stub NetrJobAdd -@ stub NetrJobDel -@ stub NetrJobEnum -@ stub NetrJobGetInfo +@ stdcall NetrJobAdd(wstr ptr ptr) +@ stdcall NetrJobDel(wstr long long) +@ stdcall NetrJobEnum(wstr ptr long ptr ptr) +@ stdcall NetrJobGetInfo(wstr long ptr)
Sorry for not catching this before committing, but the calling convention of the RPC interface is cdecl, so this won't work.
Sorry about that, thanks for noticing this.