Dmitry Timoshkov : netapi32: Implement NetScheduleJobAdd.

Alexandre Julliard julliard at winehq.org
Mon Apr 9 15:41:10 CDT 2018


Module: wine
Branch: master
Commit: 5ce26d11de52d116bcad3380c9e13283c6ccbe89
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5ce26d11de52d116bcad3380c9e13283c6ccbe89

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Thu Apr  5 15:55:45 2018 +0800

netapi32: Implement NetScheduleJobAdd.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/netapi32/Makefile.in |  5 ++++-
 dlls/netapi32/atsvc.idl   | 21 +++++++++++++++++++++
 dlls/netapi32/netapi32.c  | 35 ++++++++++++++++++++++++++++++++---
 3 files changed, 57 insertions(+), 4 deletions(-)

diff --git a/dlls/netapi32/Makefile.in b/dlls/netapi32/Makefile.in
index fda9c0e..23da483 100644
--- a/dlls/netapi32/Makefile.in
+++ b/dlls/netapi32/Makefile.in
@@ -1,7 +1,7 @@
 EXTRADEFS = -D_SVRAPI_
 MODULE    = netapi32.dll
 IMPORTLIB = netapi32
-IMPORTS   = iphlpapi ws2_32 advapi32
+IMPORTS   = rpcrt4 iphlpapi ws2_32 advapi32
 
 C_SRCS = \
 	nbcmdqueue.c \
@@ -9,3 +9,6 @@ C_SRCS = \
 	nbt.c \
 	netapi32.c \
 	netbios.c
+
+IDL_SRCS = \
+	atsvc.idl
diff --git a/dlls/netapi32/atsvc.idl b/dlls/netapi32/atsvc.idl
new file mode 100644
index 0000000..b5a2cee
--- /dev/null
+++ b/dlls/netapi32/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/netapi32/netapi32.c b/dlls/netapi32/netapi32.c
index 278d452..6185b80 100644
--- a/dlls/netapi32/netapi32.c
+++ b/dlls/netapi32/netapi32.c
@@ -39,7 +39,7 @@
 #include "winbase.h"
 #include "lm.h"
 #include "lmaccess.h"
-#include "lmat.h"
+#include "atsvc.h"
 #include "lmapibuf.h"
 #include "lmbrowsr.h"
 #include "lmshare.h"
@@ -1141,8 +1141,8 @@ NET_API_STATUS WINAPI NetUseEnum(LMSTR server, DWORD level, LPBYTE* bufptr, DWOR
 
 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;
+    TRACE("(%s, %p, %p)\n", debugstr_w(server), bufptr, jobid);
+    return NetrJobAdd(server, (AT_INFO *)bufptr, jobid);
 }
 
 NET_API_STATUS WINAPI NetScheduleJobDel(LPCWSTR server, DWORD minjobid, DWORD maxjobid)
@@ -3527,3 +3527,32 @@ DWORD WINAPI DavGetUNCFromHTTPPath(const WCHAR *http_path, WCHAR *buf, DWORD *bu
 
     return ERROR_SUCCESS;
 }
+
+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);
+}




More information about the wine-cvs mailing list