diff --git a/dlls/mstask/Makefile.in b/dlls/mstask/Makefile.in index d914666eedc..086d3c0c5ab 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 00000000000..b5a2cee0e97 --- /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 0b6c23b79de..dcfb20cab38 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 eae85562f55..c1e9036819d 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); +}