Implemented buffer management functions, a couple of workstation

information functions, created conformance tests.
oldstable
Andriy Palamarchuk 2002-09-11 02:35:17 +00:00 committed by Alexandre Julliard
parent d19aa5b702
commit b812c90c2a
19 changed files with 907 additions and 4 deletions

3
configure vendored
View File

@ -14192,7 +14192,7 @@ MAKE_TEST_RULES=dlls/Maketest.rules
MAKE_PROG_RULES=programs/Makeprog.rules
ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules programs/Makeprog.rules Makefile debugger/Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/d3d8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dsound/Makefile dlls/gdi/Makefile dlls/glu32/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msrle32/Makefile dlls/msvcrt/Makefile dlls/msvcrt20/Makefile dlls/msvideo/Makefile dlls/netapi32/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winenas/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile library/Makefile miscemu/Makefile ole/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/osversioncheck/Makefile programs/progman/Makefile programs/regapi/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/regtest/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineconsole/Makefile programs/winefile/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winetest/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/wmc/Makefile tools/wpp/Makefile tools/wrc/Makefile tsx11/Makefile unicode/Makefile"
ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules programs/Makeprog.rules Makefile debugger/Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/d3d8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dsound/Makefile dlls/gdi/Makefile dlls/glu32/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msrle32/Makefile dlls/msvcrt/Makefile dlls/msvcrt20/Makefile dlls/msvideo/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winenas/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile library/Makefile miscemu/Makefile ole/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/osversioncheck/Makefile programs/progman/Makefile programs/regapi/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/regtest/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineconsole/Makefile programs/winefile/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winetest/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/wmc/Makefile tools/wpp/Makefile tools/wrc/Makefile tsx11/Makefile unicode/Makefile"
cat >confcache <<\_ACEOF
@ -14718,6 +14718,7 @@ do
"dlls/msvcrt20/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msvcrt20/Makefile" ;;
"dlls/msvideo/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msvideo/Makefile" ;;
"dlls/netapi32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/netapi32/Makefile" ;;
"dlls/netapi32/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/netapi32/tests/Makefile" ;;
"dlls/ntdll/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/ntdll/Makefile" ;;
"dlls/ntdll/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/ntdll/tests/Makefile" ;;
"dlls/odbc32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/odbc32/Makefile" ;;

View File

@ -1409,6 +1409,7 @@ dlls/msvcrt/Makefile
dlls/msvcrt20/Makefile
dlls/msvideo/Makefile
dlls/netapi32/Makefile
dlls/netapi32/tests/Makefile
dlls/ntdll/Makefile
dlls/ntdll/tests/Makefile
dlls/odbc32/Makefile

View File

@ -802,7 +802,7 @@ msvcrt20: msvcrt.dll$(DLLEXT)
msvcrt: kernel32.dll$(DLLEXT) ntdll.dll$(DLLEXT)
msvideo: winmm.dll$(DLLEXT) comctl32.dll$(DLLEXT) version.dll$(DLLEXT) user32.dll$(DLLEXT) \
gdi32.dll$(DLLEXT) kernel32.dll$(DLLEXT)
netapi32: kernel32.dll$(DLLEXT)
netapi32: advapi32.dll$(DLLEXT) kernel32.dll$(DLLEXT)
odbc32: kernel32.dll$(DLLEXT)
ole32: advapi32.dll$(DLLEXT) user32.dll$(DLLEXT) gdi32.dll$(DLLEXT) rpcrt4.dll$(DLLEXT) \
kernel32.dll$(DLLEXT) ntdll.dll$(DLLEXT)

View File

@ -4,11 +4,17 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = netapi32.dll
IMPORTS = advapi32 kernel32
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
C_SRCS = netapi32.c
C_SRCS = \
apibuf.c \
netapi32.c \
wksta.c
SUBDIRS = tests
@MAKE_DLL_RULES@

View File

@ -0,0 +1,94 @@
/*
* Copyright 2002 Andriy Palamarchuk
*
* Net API buffer calls
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "winbase.h"
#include "lmcons.h"
#include "lmapibuf.h"
#include "lmerr.h"
#include "winerror.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(netapi32);
/************************************************************
* NetApiBufferAllocate (NETAPI32.@)
*/
NET_API_STATUS WINAPI NetApiBufferAllocate(DWORD ByteCount, LPVOID* Buffer)
{
TRACE("(%ld, %p)\n", ByteCount, Buffer);
*Buffer = HeapAlloc(GetProcessHeap(), 0, ByteCount);
if (*Buffer)
return NERR_Success;
else
return GetLastError();
}
/************************************************************
* NetApiBufferFree (NETAPI32.@)
*/
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
{
TRACE("(%p)\n", Buffer);
HeapFree(GetProcessHeap(), 0, Buffer);
return NERR_Success;
}
/************************************************************
* NetApiBufferReallocate (NETAPI32.@)
*/
NET_API_STATUS WINAPI NetApiBufferReallocate(LPVOID OldBuffer, DWORD NewByteCount,
LPVOID* NewBuffer)
{
TRACE("(%p, %ld, %p)\n", OldBuffer, NewByteCount, NewBuffer);
*NewBuffer = HeapReAlloc(GetProcessHeap(), 0, OldBuffer, NewByteCount);
if (*NewBuffer)
return NERR_Success;
else
return GetLastError();
}
/************************************************************
* NetApiBufferSize (NETAPI32.@)
*/
NET_API_STATUS WINAPI NetApiBufferSize(LPVOID Buffer, LPDWORD ByteCount)
{
DWORD dw;
TRACE("(%p, %p)\n", Buffer, ByteCount);
if (Buffer == NULL)
return ERROR_INVALID_PARAMETER;
dw = HeapSize(GetProcessHeap(), 0, Buffer);
TRACE("size: %ld\n", dw);
if (dw != 0xFFFFFFFF)
*ByteCount = dw;
else
*ByteCount = 0;
return NERR_Success;
}
/************************************************************
* NetapipBufferAllocate (NETAPI32.@)
*/
NET_API_STATUS WINAPI NetapipBufferAllocate(DWORD ByteCount, LPVOID* Buffer)
{
TRACE("(%ld, %p)\n", ByteCount, Buffer);
return NetApiBufferAllocate(ByteCount, Buffer);
}

View File

@ -1,3 +1,276 @@
init NETAPI32_LibMain
1 stdcall Netbios(ptr) Netbios
@ stub I_BrowserDebugCall
@ stub I_BrowserDebugTrace
@ stub I_BrowserQueryEmulatedDomains
@ stub I_BrowserQueryOtherDomains
@ stub I_BrowserQueryStatistics
@ stub I_BrowserResetNetlogonState
@ stub I_BrowserResetStatistics
@ stub I_BrowserServerEnum
@ stub I_BrowserSetNetlogonState
@ stub I_NetAccountDeltas
@ stub I_NetAccountSync
@ stub I_NetDatabaseDeltas
@ stub I_NetDatabaseRedo
@ stub I_NetDatabaseSync
@ stub I_NetDatabaseSync2
@ stub I_NetDfsCreateExitPoint
@ stub I_NetDfsCreateLocalPartition
@ stub I_NetDfsDeleteExitPoint
@ stub I_NetDfsDeleteLocalPartition
@ stub I_NetDfsFixLocalVolume
@ stub I_NetDfsGetVersion
@ stub I_NetDfsIsThisADomainName
@ stub I_NetDfsModifyPrefix
@ stub I_NetDfsSetLocalVolumeState
@ stub I_NetDfsSetServerInfo
@ stub I_NetGetDCList
@ stub I_NetListCanonicalize
@ stub I_NetListTraverse
@ stub I_NetLogonControl
@ stub I_NetLogonControl2
@ stub I_NetLogonSamLogoff
@ stub I_NetLogonSamLogon
@ stub I_NetLogonUasLogoff
@ stub I_NetLogonUasLogon
@ stub I_NetNameCanonicalize
@ stub I_NetNameCompare
@ stub I_NetNameValidate
@ stub I_NetPathCanonicalize
@ stub I_NetPathCompare
@ stub I_NetPathType
@ stub I_NetServerAuthenticate
@ stub I_NetServerAuthenticate2
@ stub I_NetServerPasswordSet
@ stub I_NetServerReqChallenge
@ stub I_NetServerSetServiceBits
@ stub I_NetServerSetServiceBitsEx
@ stub NetAlertRaise
@ stub NetAlertRaiseEx
@ stdcall NetApiBufferAllocate(long ptr) NetApiBufferAllocate
@ stdcall NetApiBufferFree(ptr) NetApiBufferFree
@ stdcall NetApiBufferReallocate(ptr long ptr) NetApiBufferReallocate
@ stdcall NetApiBufferSize(ptr ptr) NetApiBufferSize
@ stub NetAuditClear
@ stub NetAuditRead
@ stub NetAuditWrite
@ stub NetBrowserStatisticsGet
@ stub NetConfigGet
@ stub NetConfigGetAll
@ stub NetConfigSet
@ stub NetConnectionEnum
@ stub NetDfsAdd
@ stub NetDfsEnum
@ stub NetDfsGetInfo
@ stub NetDfsManagerGetConfigInfo
@ stub NetDfsMove
@ stub NetDfsRemove
@ stub NetDfsRename
@ stub NetDfsSetInfo
@ stub NetEnumerateTrustedDomains
@ stub NetErrorLogClear
@ stub NetErrorLogRead
@ stub NetErrorLogWrite
@ stub NetFileClose
@ stub NetFileEnum
@ stub NetFileGetInfo
@ stub NetGetAnyDCName
@ stub NetGetDCName
@ stub NetGetDisplayInformationIndex
@ stub NetGroupAdd
@ stub NetGroupAddUser
@ stub NetGroupDel
@ stub NetGroupDelUser
@ stub NetGroupEnum
@ stub NetGroupGetInfo
@ stub NetGroupGetUsers
@ stub NetGroupSetInfo
@ stub NetGroupSetUsers
@ stub NetLocalGroupAdd
@ stub NetLocalGroupAddMember
@ stub NetLocalGroupAddMembers
@ stub NetLocalGroupDel
@ stub NetLocalGroupDelMember
@ stub NetLocalGroupDelMembers
@ stub NetLocalGroupEnum
@ stub NetLocalGroupGetInfo
@ stub NetLocalGroupGetMembers
@ stub NetLocalGroupSetInfo
@ stub NetLocalGroupSetMembers
@ stub NetMessageBufferSend
@ stub NetMessageNameAdd
@ stub NetMessageNameDel
@ stub NetMessageNameEnum
@ stub NetMessageNameGetInfo
@ stub NetQueryDisplayInformation
@ stub NetRemoteComputerSupports
@ stub NetRemoteTOD
@ stub NetReplExportDirAdd
@ stub NetReplExportDirDel
@ stub NetReplExportDirEnum
@ stub NetReplExportDirGetInfo
@ stub NetReplExportDirLock
@ stub NetReplExportDirSetInfo
@ stub NetReplExportDirUnlock
@ stub NetReplGetInfo
@ stub NetReplImportDirAdd
@ stub NetReplImportDirDel
@ stub NetReplImportDirEnum
@ stub NetReplImportDirGetInfo
@ stub NetReplImportDirLock
@ stub NetReplImportDirUnlock
@ stub NetReplSetInfo
@ stub NetRplAdapterAdd
@ stub NetRplAdapterDel
@ stub NetRplAdapterEnum
@ stub NetRplBootAdd
@ stub NetRplBootDel
@ stub NetRplBootEnum
@ stub NetRplClose
@ stub NetRplConfigAdd
@ stub NetRplConfigDel
@ stub NetRplConfigEnum
@ stub NetRplGetInfo
@ stub NetRplOpen
@ stub NetRplProfileAdd
@ stub NetRplProfileClone
@ stub NetRplProfileDel
@ stub NetRplProfileEnum
@ stub NetRplProfileGetInfo
@ stub NetRplProfileSetInfo
@ stub NetRplSetInfo
@ stub NetRplSetSecurity
@ stub NetRplVendorAdd
@ stub NetRplVendorDel
@ stub NetRplVendorEnum
@ stub NetRplWkstaAdd
@ stub NetRplWkstaClone
@ stub NetRplWkstaDel
@ stub NetRplWkstaEnum
@ stub NetRplWkstaGetInfo
@ stub NetRplWkstaSetInfo
@ stub NetScheduleJobAdd
@ stub NetScheduleJobDel
@ stub NetScheduleJobEnum
@ stub NetScheduleJobGetInfo
@ stub NetServerComputerNameAdd
@ stub NetServerComputerNameDel
@ stub NetServerDiskEnum
@ stub NetServerEnum
@ stub NetServerEnumEx
@ stub NetServerGetInfo
@ stub NetServerSetInfo
@ stub NetServerTransportAdd
@ stub NetServerTransportAddEx
@ stub NetServerTransportDel
@ stub NetServerTransportEnum
@ stub NetServiceControl
@ stub NetServiceEnum
@ stub NetServiceGetInfo
@ stub NetServiceInstall
@ stub NetSessionDel
@ stub NetSessionEnum
@ stub NetSessionGetInfo
@ stub NetShareAdd
@ stub NetShareCheck
@ stub NetShareDel
@ stub NetShareDelSticky
@ stub NetShareEnum
@ stub NetShareEnumSticky
@ stub NetShareGetInfo
@ stub NetShareSetInfo
@ stub NetStatisticsGet
@ stub NetUseAdd
@ stub NetUseDel
@ stub NetUseEnum
@ stub NetUseGetInfo
@ stub NetUserAdd
@ stub NetUserChangePassword
@ stub NetUserDel
@ stub NetUserEnum
@ stub NetUserGetGroups
@ stub NetUserGetInfo
@ stub NetUserGetLocalGroups
@ stub NetUserModalsGet
@ stub NetUserModalsSet
@ stub NetUserSetGroups
@ stub NetUserSetInfo
@ stub NetWkstaGetInfo
@ stub NetWkstaSetInfo
@ stub NetWkstaTransportAdd
@ stub NetWkstaTransportDel
@ stub NetWkstaTransportEnum
@ stub NetWkstaUserEnum
@ stdcall NetWkstaUserGetInfo(wstr long ptr) NetWkstaUserGetInfo
@ stub NetWkstaUserSetInfo
@ stdcall NetapipBufferAllocate(long ptr) NetapipBufferAllocate
@ stdcall Netbios(ptr) Netbios
@ stub NetpAccessCheck
@ stub NetpAccessCheckAndAudit
@ stub NetpAllocConfigName
@ stub NetpAllocStrFromStr
@ stub NetpAllocStrFromWStr
@ stub NetpAllocTStrFromString
@ stub NetpAllocWStrFromStr
@ stub NetpAllocWStrFromWStr
@ stub NetpApiStatusToNtStatus
@ stub NetpAssertFailed
@ stub NetpCloseConfigData
@ stub NetpCopyStringToBuffer
@ stub NetpCreateSecurityObject
@ stub NetpDbgDisplayServerInfo
@ stub NetpDbgPrint
@ stub NetpDeleteSecurityObject
@ stdcall NetpGetComputerName(ptr) NetpGetComputerName
@ stub NetpGetConfigBool
@ stub NetpGetConfigDword
@ stub NetpGetConfigTStrArray
@ stub NetpGetConfigValue
@ stub NetpGetDomainName
@ stub NetpGetFileSecurity
@ stub NetpGetPrivilege
@ stub NetpHexDump
@ stub NetpInitOemString
@ stub NetpIsRemote
@ stub NetpIsUncComputerNameValid
@ stub NetpLocalTimeZoneOffset
@ stub NetpLogonPutUnicodeString
@ stub NetpNetBiosAddName
@ stub NetpNetBiosCall
@ stub NetpNetBiosDelName
@ stub NetpNetBiosGetAdapterNumbers
@ stub NetpNetBiosHangup
@ stub NetpNetBiosReceive
@ stub NetpNetBiosReset
@ stub NetpNetBiosSend
@ stub NetpNetBiosStatusToApiStatus
@ stub NetpNtStatusToApiStatus
@ stub NetpOpenConfigData
@ stub NetpPackString
@ stub NetpReleasePrivilege
@ stub NetpSetConfigBool
@ stub NetpSetConfigDword
@ stub NetpSetConfigTStrArray
@ stub NetpSetFileSecurity
@ stub NetpSmbCheck
@ stub NetpStringToNetBiosName
@ stub NetpTStrArrayEntryCount
@ stub NetpwNameCanonicalize
@ stub NetpwNameCompare
@ stub NetpwNameValidate
@ stub NetpwPathCanonicalize
@ stub NetpwPathCompare
@ stub NetpwPathType
@ stub NlBindingAddServerToCache
@ stub NlBindingRemoveServerFromCache
@ stub NlBindingSetAuthInfo
@ stub RxNetAccessAdd
@ stub RxNetAccessDel
@ stub RxNetAccessEnum
@ stub RxNetAccessGetInfo
@ stub RxNetAccessGetUserPerms
@ stub RxNetAccessSetInfo
@ stub RxNetServerEnum
@ stub RxNetUserPasswordSet
@ stub RxRemoteApi

View File

@ -0,0 +1,5 @@
Makefile
apibuf.ok
netapi32_test.exe.spec.c
testlist.c
wksta.ok

View File

@ -0,0 +1,14 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = netapi32.dll
IMPORTS = netapi32
CTESTS = \
apibuf.c \
wksta.c
@MAKE_TEST_RULES@
### Dependencies:

View File

@ -0,0 +1,65 @@
/*
* Copyright 2002 Andriy Palamarchuk
*
* Conformance test of the network buffer function.
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "wine/test.h"
#include <winbase.h>
#include <winerror.h>
#include <lmcons.h>
#include <lmerr.h>
#include <lmapibuf.h>
#include <lmaccess.h>
void run_apibuf_tests(void)
{
VOID *p;
DWORD dwSize;
/* test normal logic */
ok(NetApiBufferAllocate(1024, (LPVOID *)&p) == NERR_Success,
"Reserved memory");
ok(NetApiBufferSize(p, &dwSize) == NERR_Success, "Got size");
ok(dwSize >= 1024, "The size is correct");
ok(NetApiBufferReallocate(p, 1500, (LPVOID *) &p) == NERR_Success,
"Reallocated");
ok(NetApiBufferSize(p, &dwSize) == NERR_Success, "Got size");
ok(dwSize >= 1500, "The size is correct");
ok(NetApiBufferFree(p) == NERR_Success, "Freed");
/* test errors handling */
ok(NetApiBufferFree(p) == NERR_Success, "Freed");
ok(NetApiBufferSize(p, &dwSize) == NERR_Success, "Got size");
ok(dwSize >= 0, "The size");
ok(NetApiBufferSize(NULL, &dwSize) == ERROR_INVALID_PARAMETER, "Error for NULL pointer");
/* 0-length buffer */
ok(NetApiBufferAllocate(0, (LPVOID *)&p) == NERR_Success,
"Reserved memory");
ok(NetApiBufferSize(p, &dwSize) == NERR_Success, "Got size");
ok((dwSize >= 0) && (dwSize < 0xFFFFFFFF),"The size of the 0-length buffer");
ok(NetApiBufferFree(p) == NERR_Success, "Freed");
}
START_TEST(apibuf)
{
run_apibuf_tests();
}

View File

@ -0,0 +1,94 @@
/*
* Copyright 2002 Andriy Palamarchuk
*
* Conformance test of the workstation functions.
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "wine/test.h"
#include "winbase.h"
#include "winerror.h"
#include "nb30.h"
#include "lmcons.h"
#include "lmerr.h"
#include "lmwksta.h"
#include "lmapibuf.h"
NET_API_STATUS WINAPI NetpGetComputerName(LPWSTR *Buffer);
void run_get_comp_name_tests(void)
{
WCHAR empty[] = {0};
LPWSTR ws = empty;
ok(NetpGetComputerName(&ws) == NERR_Success, "Computer name is retrieved");
ok(ws[0] != 0, "Some value is populated to the buffer");
NetApiBufferFree(ws);
}
void run_usergetinfo_tests(void)
{
LPWKSTA_USER_INFO_0 ui0 = NULL;
LPWKSTA_USER_INFO_1 ui1 = NULL;
LPWKSTA_USER_INFO_1101 ui1101 = NULL;
DWORD dwSize;
/* Level 0 */
ok(NetWkstaUserGetInfo(NULL, 0, (LPBYTE *)&ui0) == NERR_Success,
"NetWkstaUserGetInfo is successful");
ok(lstrlenW(ui0->wkui0_username) >= 1, "Buffer is not empty");
NetApiBufferSize(ui0, &dwSize);
ok(dwSize >= (sizeof(WKSTA_USER_INFO_0) +
lstrlenW(ui0->wkui0_username) * sizeof(WCHAR)),
"Is allocated with NetApiBufferAllocate");
/* Level 1 */
ok(NetWkstaUserGetInfo(NULL, 1, (LPBYTE *)&ui1) == NERR_Success,
"NetWkstaUserGetInfo is successful");
ok(lstrlenW(ui1->wkui1_username) >= 1, "Buffer is not empty");
ok(lstrcmpW(ui1->wkui1_username, ui0->wkui0_username) == 0,
"the same name as returned for level 0");
NetApiBufferSize(ui1, &dwSize);
ok(dwSize >= (sizeof(WKSTA_USER_INFO_1) +
(lstrlenW(ui1->wkui1_username) +
lstrlenW(ui1->wkui1_logon_domain) +
lstrlenW(ui1->wkui1_oth_domains) +
lstrlenW(ui1->wkui1_logon_server)) * sizeof(WCHAR)),
"Is allocated with NetApiBufferAllocate");
/* Level 1101 */
ok(NetWkstaUserGetInfo(NULL, 1101, (LPBYTE *)&ui1101) == NERR_Success,
"NetWkstaUserGetInfo is successful");
ok(lstrcmpW(ui1101->wkui1101_oth_domains, ui1->wkui1_oth_domains) == 0,
"the same oth_domains as returned for level 1");
NetApiBufferSize(ui1101, &dwSize);
ok(dwSize >= (sizeof(WKSTA_USER_INFO_1101) +
lstrlenW(ui1101->wkui1101_oth_domains) * sizeof(WCHAR)),
"Is allocated with NetApiBufferAllocate");
NetApiBufferFree(ui0);
NetApiBufferFree(ui1);
NetApiBufferFree(ui1101);
/* errors handling */
ok(NetWkstaUserGetInfo(NULL, 10000, (LPBYTE *)&ui0) == ERROR_INVALID_LEVEL,
"Invalid level");
}
START_TEST(wksta)
{
run_get_comp_name_tests();
}

View File

@ -0,0 +1,155 @@
/*
* Copyright 2002 Andriy Palamarchuk
*
* netapi32 user functions
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "winbase.h"
#include "nb30.h"
#include "lmwksta.h"
#include "lmapibuf.h"
#include "lmerr.h"
#include "winerror.h"
#include "ntdef.h"
#include "ntsecapi.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(netapi32);
/************************************************************
* NetWkstaUserGetInfo (NETAPI32.@)
*/
NET_API_STATUS WINAPI NetWkstaUserGetInfo(LPWSTR reserved, DWORD level,
PBYTE* bufptr)
{
TRACE("(%s, %ld, %p): stub\n", debugstr_w(reserved), level, bufptr);
switch (level)
{
case 0:
{
PWKSTA_USER_INFO_0 ui;
DWORD dwSize = UNLEN + 1;
/* set up buffer */
NetApiBufferAllocate(sizeof(WKSTA_USER_INFO_0) + dwSize * sizeof(WCHAR),
(LPVOID *) &bufptr);
ui = (WKSTA_USER_INFO_0 *) *bufptr;
ui->wkui0_username = (LPWSTR) (*bufptr + sizeof(WKSTA_USER_INFO_0));
/* get data */
if (GetUserNameW(ui->wkui0_username, &dwSize))
return ERROR_NOT_ENOUGH_MEMORY;
else
return NERR_Success;
}
case 1:
{
PWKSTA_USER_INFO_1 ui;
DWORD dwSize;
LSA_OBJECT_ATTRIBUTES ObjectAttributes;
LSA_HANDLE PolicyHandle;
PPOLICY_ACCOUNT_DOMAIN_INFO DomainInfo;
NTSTATUS NtStatus;
/* sizes of the field buffers in WCHARS */
int username_sz, logon_domain_sz, oth_domains_sz, logon_server_sz;
FIXME("Level 1 processing is partially implemented\n");
username_sz = UNLEN + 1;
oth_domains_sz = 1;
logon_server_sz = 1;
/* get some information first to estimate size of the buffer */
ZeroMemory(&ObjectAttributes, sizeof(ObjectAttributes));
NtStatus = LsaOpenPolicy(NULL, &ObjectAttributes,
POLICY_VIEW_LOCAL_INFORMATION,
&PolicyHandle);
if (NtStatus != STATUS_SUCCESS)
{
ERR("LsaOpenPolicyFailed with NT status %lx\n",
LsaNtStatusToWinError(NtStatus));
return ERROR_NOT_ENOUGH_MEMORY;
}
LsaQueryInformationPolicy(PolicyHandle, PolicyAccountDomainInformation,
(PVOID*) &DomainInfo);
logon_domain_sz = lstrlenW(DomainInfo->DomainName.Buffer) + 1;
LsaClose(PolicyHandle);
/* set up buffer */
NetApiBufferAllocate(sizeof(WKSTA_USER_INFO_1) +
(username_sz + logon_domain_sz +
oth_domains_sz + logon_server_sz) * sizeof(WCHAR),
(LPVOID *) &bufptr);
ui = (WKSTA_USER_INFO_1 *) *bufptr;
ui->wkui1_username = (LPWSTR) (*bufptr + sizeof(WKSTA_USER_INFO_1));
ui->wkui1_logon_domain = (LPWSTR) (
((PBYTE) ui->wkui1_username) + username_sz * sizeof(WCHAR));
ui->wkui1_oth_domains = (LPWSTR) (
((PBYTE) ui->wkui1_logon_domain) +
logon_domain_sz * sizeof(WCHAR));
ui->wkui1_logon_server = (LPWSTR) (
((PBYTE) ui->wkui1_oth_domains) +
oth_domains_sz * sizeof(WCHAR));
/* get data */
dwSize = username_sz;
if (GetUserNameW(ui->wkui1_username, &dwSize))
return ERROR_NOT_ENOUGH_MEMORY;
lstrcpynW(ui->wkui1_logon_domain, DomainInfo->DomainName.Buffer,
logon_domain_sz);
/* FIXME. Not implemented. Populated with empty strings */
ui->wkui1_oth_domains[0] = 0;
ui->wkui1_logon_server[0] = 0;
return NERR_Success;
}
case 1101:
{
PWKSTA_USER_INFO_1101 ui;
DWORD dwSize = 1;
FIXME("Stub. Level 1101 processing is not implemented\n");
/* FIXME see also wkui1_oth_domains for level 1 */
/* set up buffer */
NetApiBufferAllocate(sizeof(WKSTA_USER_INFO_1101) + dwSize * sizeof(WCHAR),
(LPVOID *) &bufptr);
ui = (PWKSTA_USER_INFO_1101) *bufptr;
ui->wkui1101_oth_domains = (LPWSTR)(ui + 1);
/* get data */
ui->wkui1101_oth_domains[0] = 0;
return NERR_Success;
}
default:
ERR("Invalid level %ld is specified\n", level);
return ERROR_INVALID_LEVEL;
}
}
/************************************************************
* NetpGetComputerName (NETAPI32.@)
*/
NET_API_STATUS WINAPI NetpGetComputerName(LPWSTR *Buffer)
{
DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1;
TRACE("(%p)\n", Buffer);
NetApiBufferAllocate(dwSize * sizeof(WCHAR), (LPVOID *) Buffer);
return !GetComputerNameW(*Buffer, &dwSize);
}

View File

@ -38,7 +38,12 @@ INSTALLED_INCLUDES = \
imm.h \
initguid.h \
instance.h \
lm.h \
lmaccess.h \
lmapibuf.h \
lmcons.h \
lmerr.h \
lmwksta.h \
lzexpand.h \
mapi.h \
mapicode.h \

30
include/lm.h 100644
View File

@ -0,0 +1,30 @@
/*
* Copyright 2002 Andriy Palamarchuk
*
* General lm header which includes other lm headers.
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_LM_H
#define __WINE_LM_H
#include <lmcons.h>
#include <lmerr.h>
#include <lmaccess.h>
#include <lmwksta.h>
#include <lmapibuf.h>
#endif

31
include/lmaccess.h 100644
View File

@ -0,0 +1,31 @@
/*
* Copyright 2002 Andriy Palamarchuk
*
* User API.
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_LMAPIBUF_H
#define __WINE_LMAPIBUF_H
typedef struct _USER_INFO_10 {
LPWSTR usri10_name;
LPWSTR usri10_comment;
LPWSTR usri10_usr_comment;
LPWSTR usri10_full_name;
} USER_INFO_10, *PUSER_INFO_10, *LPUSER_INFO_10;
#endif

40
include/lmapibuf.h 100644
View File

@ -0,0 +1,40 @@
/*
* Copyright 2002 Andriy Palamarchuk
*
* Net API buffer calls
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_LMAPIBUF_H
#define __WINE_LMAPIBUF_H
#ifdef __cplusplus
extern "C" {
#endif
/* Buffer functions */
NET_API_STATUS WINAPI NetApiBufferAllocate(DWORD ByteCount, LPVOID* Buffer);
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer);
NET_API_STATUS WINAPI NetApiBufferReallocate(LPVOID OldBuffer, DWORD NewByteCount,
LPVOID* NewBuffer);
NET_API_STATUS WINAPI NetApiBufferSize(LPVOID Buffer, LPDWORD ByteCount);
NET_API_STATUS WINAPI NetapipBufferAllocate(DWORD ByteCount, LPVOID* Buffer);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -19,6 +19,10 @@
#ifndef __WINE_LMCONS_H
#define __WINE_LMCONS_H
/* Types */
#define NET_API_STATUS DWORD
/* Lan manager API defines */
#define UNLEN 256 /* Maximum user name length */

30
include/lmerr.h 100644
View File

@ -0,0 +1,30 @@
/*
* Copyright 2002 Andriy Palamarchuk
*
* NERR error codes.
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_LMERR_H
#define __WINE_LMERR_H
#define NERR_Success 0
#define NERR_BASE 2100
#define MAX_NERR (NERR_BASE+899)
#endif

53
include/lmwksta.h 100644
View File

@ -0,0 +1,53 @@
/*
* Copyright 2002 Andriy Palamarchuk
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_LMWKSTA_H
#define __WINE_LMWKSTA_H
#include <lmcons.h>
#ifdef __cplusplus
extern "C" {
#endif
/* NetBIOS */
UCHAR WINAPI Netbios(PNCB pncb);
typedef struct _WKSTA_USER_INFO_0 {
LPWSTR wkui0_username;
} WKSTA_USER_INFO_0, *PWKSTA_USER_INFO_0, *LPWKSTA_USER_INFO_0;
typedef struct _WKSTA_USER_INFO_1 {
LPWSTR wkui1_username;
LPWSTR wkui1_logon_domain;
LPWSTR wkui1_oth_domains;
LPWSTR wkui1_logon_server;
} WKSTA_USER_INFO_1, *PWKSTA_USER_INFO_1, *LPWKSTA_USER_INFO_1;
typedef struct _WKSTA_USER_INFO_1101 {
LPWSTR wkui1101_oth_domains;
} WKSTA_USER_INFO_1101, *PWKSTA_USER_INFO_1101, *LPWKSTA_USER_INFO_1101;
/* workstation */
NET_API_STATUS WINAPI NetWkstaUserGetInfo(LPWSTR reserved, DWORD level, PBYTE* bufptr);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -189,6 +189,8 @@ typedef struct
#define DRIVE_CDROM 5
#define DRIVE_RAMDISK 6
#define MAX_COMPUTERNAME_LENGTH 31
/* The security attributes structure */
typedef struct _SECURITY_ATTRIBUTES
{