[NETAPI32]

- Implement NetShareAdd, NetShareCheck, NetShareDel and NetShareDelSticky. These functions call their counterparts in the server service.
- Add stubs for NetShareEnum, NetShareEnumSticky, NetShareGetInfo and NetShareSetInfo.
- Get rid of the NetShare wine stubs.

svn path=/trunk/; revision=74752
This commit is contained in:
Eric Kohl 2017-06-02 20:02:49 +00:00
parent 8679f001d9
commit daff560348
3 changed files with 201 additions and 65 deletions

View file

@ -225,13 +225,13 @@
@ stub NetSessionGetInfo
@ stub NetSetPrimaryComputerName
@ stdcall NetShareAdd(wstr long ptr ptr)
@ stub NetShareCheck
@ stdcall NetShareCheck(wstr wstr ptr)
@ stdcall NetShareDel(wstr wstr long)
@ stub NetShareDelSticky
@ stdcall NetShareDelSticky(wstr wstr long)
@ stdcall NetShareEnum(wstr long ptr long ptr ptr ptr)
@ stub NetShareEnumSticky
@ stdcall NetShareEnumSticky(wstr long ptr long ptr ptr ptr)
@ stdcall NetShareGetInfo(wstr wstr long ptr)
@ stub NetShareSetInfo
@ stdcall NetShareSetInfo(wstr wstr long ptr ptr)
@ stdcall NetStatisticsGet(wstr wstr long long ptr)
@ stub NetUnjoinDomain
@ stub NetUnregisterDomainNameChangeNotification

View file

@ -56,62 +56,6 @@ NET_API_STATUS WINAPI NetSessionEnum(LMSTR servername, LMSTR UncClientName,
return NERR_Success;
}
/************************************************************
* NetShareEnum (NETAPI32.@)
*
* PARAMS
* servername [I] Pointer to a string with the name of the server
* level [I] Data information level
* bufptr [O] Buffer to the data
* prefmaxlen [I] Preferred maximum length of the data
* entriesread [O] Pointer to the number of entries enumerated
* totalentries [O] Pointer to the possible number of entries
* resume_handle [I/O] Pointer to a handle for subsequent searches
*
* RETURNS
* If successful, the function returns NERR_Success
* On failure it returns a system error code (FIXME: find out which)
*
*/
NET_API_STATUS WINAPI NetShareEnum( LMSTR servername, DWORD level, LPBYTE* bufptr,
DWORD prefmaxlen, LPDWORD entriesread, LPDWORD totalentries, LPDWORD resume_handle)
{
FIXME("Stub (%s %d %p %d %p %p %p)\n", debugstr_w(servername), level, bufptr,
prefmaxlen, entriesread, totalentries, resume_handle);
return ERROR_NOT_SUPPORTED;
}
/************************************************************
* NetShareDel (NETAPI32.@)
*/
NET_API_STATUS WINAPI NetShareDel(LMSTR servername, LMSTR netname, DWORD reserved)
{
FIXME("Stub (%s %s %d)\n", debugstr_w(servername), debugstr_w(netname), reserved);
return NERR_Success;
}
/************************************************************
* NetShareGetInfo (NETAPI32.@)
*/
NET_API_STATUS WINAPI NetShareGetInfo(LMSTR servername, LMSTR netname,
DWORD level, LPBYTE *bufptr)
{
FIXME("Stub (%s %s %d %p)\n", debugstr_w(servername),
debugstr_w(netname),level, bufptr);
return NERR_NetNameNotFound;
}
/************************************************************
* NetShareAdd (NETAPI32.@)
*/
NET_API_STATUS WINAPI NetShareAdd(LMSTR servername,
DWORD level, LPBYTE buf, LPDWORD parm_err)
{
FIXME("Stub (%s %d %p %p)\n", debugstr_w(servername), level, buf, parm_err);
return ERROR_NOT_SUPPORTED;
}
/************************************************************
* NetFileEnum (NETAPI32.@)
*/

View file

@ -1,10 +1,9 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: NetAPI DLL
* FILE: reactos/dll/win32/netapi32/schedule.c
* FILE: reactos/dll/win32/netapi32/srvsvc.c
* PURPOSE: Server service interface code
*
* PROGRAMMERS: Eric Kohl
* PROGRAMMERS: Eric Kohl <eric.kohl@reactos.org>
*/
/* INCLUDES ******************************************************************/
@ -74,8 +73,8 @@ SRVSVC_HANDLE_unbind(SRVSVC_HANDLE pszSystemName,
NET_API_STATUS
WINAPI
NetRemoteTOD(
LPCWSTR UncServerName,
LPBYTE *BufferPtr)
_In_ LPCWSTR UncServerName,
_Out_ LPBYTE *BufferPtr)
{
NET_API_STATUS status;
@ -98,4 +97,197 @@ NetRemoteTOD(
return status;
}
NET_API_STATUS
WINAPI
NetShareAdd(
_In_ LMSTR servername,
_In_ DWORD level,
_In_ LPBYTE buf,
_Out_ LPDWORD parm_err)
{
NET_API_STATUS status;
TRACE("NetShareAdd(%s %lu %p %p)\n",
debugstr_w(servername), level, buf, parm_err);
if (level != 2 || level != 502 || level != 503)
return ERROR_INVALID_LEVEL;
RpcTryExcept
{
status = NetrShareAdd(servername,
level,
(LPSHARE_INFO)&buf,
parm_err);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
status = I_RpcMapWin32Status(RpcExceptionCode());
}
RpcEndExcept;
return status;
}
NET_API_STATUS
WINAPI
NetShareCheck(
_In_ LMSTR servername,
_In_ LMSTR device,
_Out_ LPDWORD type)
{
NET_API_STATUS status;
TRACE("NetShareCheck(%s %s %p)\n",
debugstr_w(servername), debugstr_w(device), type);
RpcTryExcept
{
status = NetrShareCheck(servername,
device,
type);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
status = I_RpcMapWin32Status(RpcExceptionCode());
}
RpcEndExcept;
return status;
}
NET_API_STATUS
WINAPI
NetShareDel(
_In_ LMSTR servername,
_In_ LMSTR netname,
_In_ DWORD reserved)
{
NET_API_STATUS status;
TRACE("NetShareDel(%s %s %lu)\n",
debugstr_w(servername), debugstr_w(netname), reserved);
if (netname == NULL || (*netname == 0) || reserved != 0)
return ERROR_INVALID_PARAMETER;
RpcTryExcept
{
status = NetrShareDel(servername,
netname,
reserved);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
status = I_RpcMapWin32Status(RpcExceptionCode());
}
RpcEndExcept;
return status;
}
NET_API_STATUS
WINAPI
NetShareDelSticky(
_In_ LMSTR servername,
_In_ LMSTR netname,
_In_ DWORD reserved)
{
NET_API_STATUS status;
TRACE("NetShareDelSticky(%s %s %lu)\n",
debugstr_w(servername), debugstr_w(netname), reserved);
if (netname == NULL || (*netname == 0) || reserved != 0)
return ERROR_INVALID_PARAMETER;
RpcTryExcept
{
status = NetrShareDelSticky(servername,
netname,
reserved);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
status = I_RpcMapWin32Status(RpcExceptionCode());
}
RpcEndExcept;
return status;
}
NET_API_STATUS
WINAPI
NetShareEnum(
_In_ LMSTR servername,
_In_ DWORD level,
_Out_ LPBYTE *bufptr,
_In_ DWORD prefmaxlen,
_Out_ LPDWORD entriesread,
_Out_ LPDWORD totalentries,
_Inout_ LPDWORD resume_handle)
{
FIXME("NetShareEnum(%s %lu %p %lu %p %p %p)\n",
debugstr_w(servername), level, bufptr, prefmaxlen,
entriesread, totalentries, resume_handle);
return ERROR_NOT_SUPPORTED;
}
NET_API_STATUS
WINAPI
NetShareEnumSticky(
_In_ LMSTR servername,
_In_ DWORD level,
_Out_ LPBYTE *bufptr,
_In_ DWORD prefmaxlen,
_Out_ LPDWORD entriesread,
_Out_ LPDWORD totalentries,
_Inout_ LPDWORD resume_handle)
{
FIXME("NetShareEnumSticky(%s %lu %p %lu %p %p %p)\n",
debugstr_w(servername), level, bufptr, prefmaxlen,
entriesread, totalentries, resume_handle);
return ERROR_NOT_SUPPORTED;
}
NET_API_STATUS
WINAPI
NetShareGetInfo(
_In_ LMSTR servername,
_In_ LMSTR netname,
_In_ DWORD level,
_Out_ LPBYTE *bufptr)
{
FIXME("NetShareGetInfo(%s %s %lu %p)\n",
debugstr_w(servername), debugstr_w(netname), level, bufptr);
return ERROR_NOT_SUPPORTED;
}
NET_API_STATUS
WINAPI
NetShareSetInfo(
_In_ LPWSTR servername,
_In_ LPWSTR netname,
_In_ DWORD level,
_In_ LPBYTE buf,
_Out_ LPDWORD parm_err)
{
FIXME("NetShareSetInfo(%s %s %lu %p %p)\n",
debugstr_w(servername), debugstr_w(netname), level, buf, parm_err);
return ERROR_NOT_SUPPORTED;
}
/* EOF */