[NETAPI32]

- Implement NetFileClose, NetFileEnum and NetFileGetInfo. These functions call their counterparts in the server service.
- Get rid of share.c as it is no longer needed.

svn path=/trunk/; revision=74913
This commit is contained in:
Eric Kohl 2017-06-04 15:46:29 +00:00
parent 61b665bdda
commit 09d56b8cff
4 changed files with 140 additions and 40 deletions

View file

@ -26,7 +26,6 @@ list(APPEND SOURCE
netapi32.c
netbios.c
schedule.c
share.c
srvsvc.c
user.c
wksta.c

View file

@ -144,9 +144,9 @@
@ stub NetErrorLogClear
@ stub NetErrorLogRead
@ stub NetErrorLogWrite
@ stub NetFileClose
@ stdcall NetFileClose(wstr long)
@ stdcall NetFileEnum(wstr wstr wstr long ptr long ptr ptr ptr)
@ stub NetFileGetInfo
@ stdcall NetFileGetInfo(wstr long long ptr)
@ stdcall NetGetAnyDCName(wstr wstr ptr)
@ stdcall NetGetDCName(wstr wstr ptr)
@ stub NetGetDisplayInformationIndex

View file

@ -1,33 +0,0 @@
/* Copyright 2006 Paul Vriens
*
* 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
*/
#include "netapi32.h"
WINE_DEFAULT_DEBUG_CHANNEL(share);
/************************************************************
* NetFileEnum (NETAPI32.@)
*/
NET_API_STATUS WINAPI NetFileEnum(
LPWSTR ServerName, LPWSTR BasePath, LPWSTR UserName,
DWORD Level, LPBYTE* BufPtr, DWORD PrefMaxLen,
LPDWORD EntriesRead, LPDWORD TotalEntries, PDWORD_PTR ResumeHandle)
{
FIXME("(%s, %s, %s, %u): stub\n", debugstr_w(ServerName), debugstr_w(BasePath),
debugstr_w(UserName), Level);
return ERROR_NOT_SUPPORTED;
}

View file

@ -70,6 +70,140 @@ SRVSVC_HANDLE_unbind(SRVSVC_HANDLE pszSystemName,
}
NET_API_STATUS
WINAPI
NetFileClose(
_In_ LMSTR servername,
_In_ DWORD fileid)
{
NET_API_STATUS status;
TRACE("NetFileClose(%s %lu)\n",
debugstr_w(servername), fileid);
RpcTryExcept
{
status = NetrFileClose(servername,
fileid);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
status = I_RpcMapWin32Status(RpcExceptionCode());
}
RpcEndExcept;
return status;
}
NET_API_STATUS
WINAPI
NetFileEnum(
_In_ LMSTR servername,
_In_ LMSTR basepath,
_In_ LMSTR username,
_In_ DWORD level,
_Out_ LPBYTE *bufptr,
_In_ DWORD prefmaxlen,
_Out_ LPDWORD entriesread,
_Out_ LPDWORD totalentries,
_Inout_ PDWORD_PTR resume_handle)
{
FILE_ENUM_STRUCT EnumStruct;
FILE_INFO_2_CONTAINER Level2Container = {0, NULL};
FILE_INFO_3_CONTAINER Level3Container = {0, NULL};
NET_API_STATUS status;
TRACE("NetFileEnum(%s %s %s %lu %p %lu %p %p %p)\n",
debugstr_w(servername), debugstr_w(basepath), debugstr_w(username),
level, bufptr, prefmaxlen, entriesread, totalentries, resume_handle);
if (level != 2 && level != 3)
return ERROR_INVALID_LEVEL;
EnumStruct.Level = level;
switch (level)
{
case 2:
EnumStruct.FileInfo.Level2 = &Level2Container;
break;
case 3:
EnumStruct.FileInfo.Level3 = &Level3Container;
break;
}
RpcTryExcept
{
status = NetrFileEnum(servername,
basepath,
username,
&EnumStruct,
prefmaxlen,
totalentries,
(PDWORD)resume_handle);
switch (level)
{
case 2:
if (EnumStruct.FileInfo.Level2->Buffer != NULL)
{
*bufptr = (LPBYTE)EnumStruct.FileInfo.Level2->Buffer;
*entriesread = EnumStruct.FileInfo.Level2->EntriesRead;
}
break;
case 3:
if (EnumStruct.FileInfo.Level3->Buffer != NULL)
{
*bufptr = (LPBYTE)EnumStruct.FileInfo.Level3->Buffer;
*entriesread = EnumStruct.FileInfo.Level3->EntriesRead;
}
break;
}
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
status = I_RpcMapWin32Status(RpcExceptionCode());
}
RpcEndExcept;
return status;
}
NET_API_STATUS
WINAPI
NetFileGetInfo(
_In_ LMSTR servername,
_In_ DWORD fileid,
_In_ DWORD level,
_Out_ LPBYTE *bufptr)
{
NET_API_STATUS status;
TRACE("NetFileGetInfo(%s %lu %lu %p)\n",
debugstr_w(servername), fileid, level, bufptr);
*bufptr = NULL;
RpcTryExcept
{
status = NetrFileGetInfo(servername,
fileid,
level,
(LPFILE_INFO)bufptr);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
status = I_RpcMapWin32Status(RpcExceptionCode());
}
RpcEndExcept;
return status;
}
NET_API_STATUS
WINAPI
NetRemoteTOD(
@ -78,8 +212,8 @@ NetRemoteTOD(
{
NET_API_STATUS status;
TRACE("NetRemoteTOD(%s, %p)\n", debugstr_w(UncServerName),
BufferPtr);
TRACE("NetRemoteTOD(%s %p)\n",
debugstr_w(UncServerName), BufferPtr);
*BufferPtr = NULL;
@ -147,7 +281,7 @@ NetSessionEnum(
SESSION_INFO_502_CONTAINER Level502Container = {0, NULL};
NET_API_STATUS status;
FIXME("NetSessionEnum(%s %s %s %lu %p %lu %p %p %p)\n",
TRACE("NetSessionEnum(%s %s %s %lu %p %lu %p %p %p)\n",
debugstr_w(servername), debugstr_w(UncClientName), debugstr_w(username),
level, bufptr, prefmaxlen, entriesread, totalentries, resume_handle);
@ -264,7 +398,7 @@ NetSessionGetInfo(
DWORD dwTotalEntries;
NET_API_STATUS status;
FIXME("NetSessionGetInfo(%s %s %s %lu %p)\n",
TRACE("NetSessionGetInfo(%s %s %s %lu %p)\n",
debugstr_w(servername), debugstr_w(UncClientName),
debugstr_w(username), level, bufptr);