diff options
Diffstat (limited to '')
-rw-r--r-- | private/nw/inc/ncp.h | 488 | ||||
-rw-r--r-- | private/nw/inc/nds.h | 226 | ||||
-rw-r--r-- | private/nw/inc/ndsapi32.h | 330 | ||||
-rw-r--r-- | private/nw/inc/ntddnwfs.h | 625 | ||||
-rw-r--r-- | private/nw/inc/nwapi.h | 197 | ||||
-rw-r--r-- | private/nw/inc/nwapi32.h | 810 | ||||
-rw-r--r-- | private/nw/inc/nwcanon.h | 55 | ||||
-rw-r--r-- | private/nw/inc/nwcons.h | 39 | ||||
-rw-r--r-- | private/nw/inc/nwpapi32.h | 297 | ||||
-rw-r--r-- | private/nw/inc/nwpkstr.h | 37 | ||||
-rw-r--r-- | private/nw/inc/nwrnames.h | 55 | ||||
-rw-r--r-- | private/nw/inc/nwrpcp.h | 138 | ||||
-rw-r--r-- | private/nw/inc/nwsnames.h | 27 | ||||
-rw-r--r-- | private/nw/inc/nwstatus.h | 27 | ||||
-rw-r--r-- | private/nw/inc/nwsvc.h | 88 | ||||
-rw-r--r-- | private/nw/inc/nwxchg.h | 45 | ||||
-rw-r--r-- | private/nw/inc/usa/messages.inc | 41 | ||||
-rw-r--r-- | private/nw/inc/validc.h | 87 |
18 files changed, 3612 insertions, 0 deletions
diff --git a/private/nw/inc/ncp.h b/private/nw/inc/ncp.h new file mode 100644 index 000000000..886fecba5 --- /dev/null +++ b/private/nw/inc/ncp.h @@ -0,0 +1,488 @@ +/*++ BUILD Version: 0001 // Increment this if a change has global effects + +Copyright (c) 1993 Microsoft Corporation + +Module Name: + + ncp.h + +Abstract: + + This module defines NCP fields and constants. + +Author: + + Manny Weiser (mannyw) 10-Aug-1993 + +Revision History: + +--*/ + +#ifndef _NCP_ +#define _NCP_ + +///////////////////////////////// IPX /////////////////////////////////////// + +#define RIP_SOCKET 0x5304 +#define SAP_SOCKET 0x5204 +#define NCP_SOCKET 0x5104 + +// +// SAP request types +// + +#define SAP_GENERAL_REQUEST 1 +#define SAP_FIND_NEAREST 3 + +// +// SAP services +// + +#define SAP_SERVICE_TYPE_SERVER 4 +#define SAP_SERVICE_TYPE_DIR_SERVER 278 + +///// IPX driver services: + +#ifndef NWDOS_INCLUDED + +typedef UCHAR byte; +typedef USHORT word; + +#endif + +typedef ULONG NetAddress; +typedef byte NodeAddress [6]; + +typedef struct +{ + NetAddress Net; + NodeAddress Node; + word Socket; +} IPXaddress; + +NTSTATUS IPX_Get_Local_Target ( IPXaddress*, NodeAddress*, word* ); +void IPX_Get_Internetwork_Address ( IPXaddress* ); +word IPX_Get_Interval_Marker ( void ); + +struct _IRP_CONTEXT; +struct _NW_TDI_STRUCT; + +NTSTATUS +IPX_Open_Socket( + IN struct _IRP_CONTEXT* pIrpC, + IN struct _NW_TDI_STRUCT* pTdiStruc + ); + +VOID +IPX_Close_Socket( + IN struct _NW_TDI_STRUCT* pTdiStruc + ); + +///// IPX support routines to hide V86/VxD differences: + +//byte* IPX_Allocate_Low_Memory ( word ); +//ESR* IPX_Wrap_Callback ( ESR* ); + +///////////////////////////////// SAP /////////////////////////////////////// + +typedef struct +{ + word Command; + word ServerType; + char Name [48]; + IPXaddress Address; + word Hops; +} SAPpacket; + +///////////////////////////////// RIP /////////////////////////////////////// + +typedef struct +{ + word Command; + NetAddress Net; + word Hops; + word Ticks; +} RIPpacket; + +///////////////////////////////// PEP /////////////////////////////////////// + +#define PEP_COMMAND_CONNECT 0x1111 +#define PEP_COMMAND_REQUEST 0x2222 +#define PEP_COMMAND_RESPONSE 0x3333 +#define PEP_COMMAND_DISCONNECT 0x5555 +#define PEP_COMMAND_BURST 0x7777 +#define PEP_COMMAND_ACKNOWLEDGE 0x9999 + +typedef struct +{ + word command; + byte sequence; + byte connection; + byte x; +} PEPrequest; + +typedef struct +{ + byte error; + byte status; +} PEPresponse; + +// +// Bindery object types +// + +#define OT_WILD ~0 +#define OT_USER 1 +#define OT_GROUP 2 +#define OT_PRINT_QUEUE 3 +#define OT_FILESERVER 4 +#define OT_DIRSERVER 0x278 +#define OT_JOBQUEUE 0xA + +#define ENCRYPTION_KEY_SIZE 8 +#define OBJECT_ID_SIZE 4 + +#define BROADCAST_MESSAGE_WAITING 0x21 + +// +// NCP function codes +// + +#define NCP_MESSAGE_FUNCTION 0x15 +#define NCP_DIR_FUNCTION 0x16 +#define NCP_ADMIN_FUNCTION 0x17 +#define NCP_END_OF_JOB 0x18 +#define NCP_LOGOUT 0x19 +#define NCP_LOCK_RANGE 0x1A +#define NCP_UNLOCK_RANGE 0x1E +#define NCP_NEGOTIATE_BUFFER_SIZE 0x21 +#define NCP_GET_SHORT_NAME 0x30 +#define NCP_FLUSH_FILE 0x3D +#define NCP_SEARCH_INITIATE 0x3E +#define NCP_SEARCH_CONTINUE 0x3F +#define NCP_SEARCH_FILE 0x40 +#define NCP_CLOSE 0x42 +#define NCP_CREATE_FILE 0x43 +#define NCP_DELETE_FILE 0x44 +#define NCP_RENAME_FILE 0x45 +#define NCP_SET_FILE_ATTRIBUTES 0x46 +#define NCP_GET_FILE_SIZE 0x47 +#define NCP_READ_FILE 0x48 +#define NCP_WRITE_FILE 0x49 +#define NCP_SET_FILE_TIME 0x4B +#define NCP_OPEN_FILE 0x4C +#define NCP_CREATE_NEW_FILE 0x4D +#define NCP_LFN_FUNCTION 0x57 +#define NCP_NEGOTIATE_LIP_CONNECTION 0x61 +#define NCP_NEGOTIATE_BURST_CONNECTION 0x65 + +// +// Subfunctions of NCP_MESSAGE_FUNCTION +// + +#define NCP_GET_MESSAGE 0x01 +#define NCP_GET_ENTIRE_MESSAGE 0x0B + +// +// Subfunctions of NCP_DIR_FUNCTION +// + +#define NCP_GET_DIRECTORY_PATH 0x01 +#define NCP_GET_VOLUME_NUMBER 0x05 +#define NCP_CREATE_DIRECTORY 0x0A +#define NCP_DELETE_DIRECTORY 0x0B +#define NCP_RENAME_DIRECTORY 0x0F +#define NCP_ALLOCATE_DIR_HANDLE 0x12 +#define NCP_ALLOCATE_TEMP_DIR_HANDLE 0x13 +#define NCP_DEALLOCATE_DIR_HANDLE 0x14 +#define NCP_GET_VOLUME_STATS 0x15 +#define NCP_GET_VOLUME_INFO 0x2C +#define NCP_GET_NAME_SPACE_INFO 0x2F + +// +// Subfunctions of NCP_ADMIN_FUNCTION +// + +#define NCP_GET_SERVER_INFO 0x11 +#define NCP_PLAIN_TEXT_LOGIN 0x14 +#define NCP_GET_LOGIN_KEY 0x17 +#define NCP_ENCRYPTED_LOGIN 0x18 +#define NCP_CHANGE_CONN_AUTH_STATUS 0x1D +#define NCP_QUERY_OBJECT_ID 0x35 +#define NCP_SCAN_BINDERY_OBJECT 0x37 +#define NCP_QUERY_PROPERTY_VALUE 0x3D +#define NCP_PLAIN_TEXT_VERIFY_PASSWORD 0x3F +#define NCP_IS_OBJECT_IN_SET 0x43 +#define NCP_ENCRYPTED_VERIFY_PASSWORD 0x4A +#define NCP_CREATE_QUEUE_JOB 0x68 +#define NCP_CLOSE_FILE_AND_START_JOB 0x69 +#define NCP_CLOSE_FILE_AND_CANCEL_JOB 0x6A +#define NCP_SUBFUNC_79 0x79 // BUGBUG +#define NCP_SUBFUNC_7F 0x7F // BUGBUG + +// +// Values for NCP_CHANGE_CONN_AUTH_STATUS +// + +#define NCP_CONN_NOT_LICENSED 0 +#define NCP_CONN_LICENSED 1 + +// +// Subfunctions of NCP_NAME_SPACE_FUNCTION +// + +#define NCP_LFN_OPEN_CREATE 0x01 +#define NCP_LFN_SEARCH_INITIATE 0x02 +#define NCP_LFN_SEARCH_CONTINUE 0x03 +#define NCP_LFN_RENAME_FILE 0x04 +#define NCP_LFN_GET_INFO 0x06 +#define NCP_LFN_SET_INFO 0x07 +#define NCP_LFN_DELETE_FILE 0x08 +#define NCP_LFN_ALLOCATE_DIR_HANDLE 0x0C + +// +// Packet types +// + +#define PACKET_TYPE_SAP 0x00 +#define PACKET_TYPE_NCP 0x11 + +// +// Special character used to indicate that the next char in the +// search mask is a wild card character. +// + +#define LFN_META_CHARACTER (UCHAR)0xFF + +// +// Properties we query and set +// + +#define NET_ADDRESS_PROPERTY "NET_ADDRESS" + +// +// Search attributes +// + +#define SEARCH_ALL_DIRECTORIES 0x16 +#define SEARCH_ALL_FILES 0x06 +#define SEARCH_EXEC_ONLY_FILES 0x4E + +// File Attributes + +#define NW_ATTRIBUTE_SHARABLE 0x80 +#define NW_ATTRIBUTE_ARCHIVE 0x20 +#define NW_ATTRIBUTE_DIRECTORY 0x10 +#define NW_ATTRIBUTE_EXECUTE_ONLY 0x08 +#define NW_ATTRIBUTE_SYSTEM 0x04 +#define NW_ATTRIBUTE_HIDDEN 0x02 +#define NW_ATTRIBUTE_READ_ONLY 0x01 +#define NW_ATTRIBUTE_EXEC_ONLY 0x4E + +// Open Flags + +#define NW_OPEN_EXCLUSIVE 0x10 +#define NW_DENY_WRITE 0x08 +#define NW_DENY_READ 0x04 +#define NW_OPEN_FOR_WRITE 0x02 +#define NW_OPEN_FOR_READ 0x01 + +// +// Connection status flags +// + +#define NCP_STATUS_BAD_CONNECTION 0x01 +#define NCP_STATUS_NO_CONNECTIONS 0x02 +#define NCP_STATUS_SERVER_DOWN 0x04 +#define NCP_STATUS_MSG_PENDING 0x08 +#define NCP_STATUS_SHUTDOWN 0x10 + +// +// Extended name space (long file name) query information flags +// + +#define LFN_FLAG_INFO_NAME 0x0001 +#define LFN_FLAG_INFO_BLOCK_SIZE 0x0002 +#define LFN_FLAG_INFO_ATTRIBUTES 0x0004 +#define LFN_FLAG_INFO_FILE_SIZE 0x0008 +#define LFN_FLAG_INFO_STREAMS 0x0010 +#define LFN_FLAG_INFO_EA_INFO 0x0020 +#define LFN_FLAG_INFO_ARCHIVE_TIME 0x0040 +#define LFN_FLAG_INFO_MODIFY_TIME 0x0080 +#define LFN_FLAG_INFO_CREATION_TIME 0x0100 +#define LFN_FLAG_INFO_CREATOR 0x0200 +#define LFN_FLAG_INFO_DIR_INFO 0x0400 +#define LFN_FLAG_INFO_RIGHTS 0x0800 + +// +// Extended name space (long file name) set information flags +// + +#define LFN_FLAG_SET_NAME 0x0001 // Never used +#define LFN_FLAG_SET_INFO_ATTRIBUTES 0x0002 +#define LFN_FLAG_SET_INFO_CREATE_DATE 0x0004 +#define LFN_FLAG_SET_INFO_CREATE_TIME 0x0008 +#define LFN_FLAG_SET_INFO_CREATOR_ID 0x0010 +#define LFN_FLAG_SET_INFO_ARCHIVE_DATE 0x0020 +#define LFN_FLAG_SET_INFO_ARCHIVE_TIME 0x0040 +#define LFN_FLAG_SET_INFO_ARCHIVE_ID 0x0080 +#define LFN_FLAG_SET_INFO_MODIFY_DATE 0x0100 +#define LFN_FLAG_SET_INFO_MODIFY_TIME 0x0200 +#define LFN_FLAG_SET_INFO_MODIFY_ID 0x0400 +#define LFN_FLAG_SET_INFO_LASTACCESS_DATE 0x0800 +#define LFN_FLAG_SET_INFO_INHERITANCE 0x1000 +#define LFN_FLAG_SET_INFO_MAXIMUM_SPACE 0x2000 + +// +// Extended name space (long file name) open mode flags +// + +#define LFN_FLAG_OM_OPEN 0x01 +#define LFN_FLAG_OM_OVERWRITE 0x02 +#define LFN_FLAG_OM_CREATE 0x08 + +// +// Long name directory flags +// + +#define LFN_FLAG_SHORT_DIRECTORY 0x00 + +// +// Burst request +// + +#define BURST_REQUEST_READ 0x01 +#define BURST_REQUEST_WRITE 0x02 + +// +// Burst flags +// + +#define BURST_FLAG_END_OF_BURST 0x10 +#define BURST_FLAG_SYSTEM_PACKET 0x80 + +///////////////////////////////////////////////////////////////////////////// + +#define MAX_SERVER_NAME_LENGTH 48 + +#include <packon.h> + +typedef struct _SAP_FIND_NEAREST_RESPONSE { + USHORT SapType; // == 4 + USHORT SapServiceType; + UCHAR ServerName[MAX_SERVER_NAME_LENGTH]; + ULONG Network; + UCHAR NodeNumber[6]; + USHORT HopCount; // Hi-lo order +} SAP_FIND_NEAREST_RESPONSE, *PSAP_FIND_NEAREST_RESPONSE; + +typedef struct _NCP_HEADER { + USHORT Command; + UCHAR SequenceNumber; + UCHAR ConnectionIdLow; + UCHAR TaskId; + UCHAR ConnectionIdHigh; +} NCP_HEADER, *PNCP_HEADER; + +// +// Header format for NCP request with no subfunction. +// + +typedef struct _NCP_REQUEST { + NCP_HEADER NcpHeader; + UCHAR FunctionCode; + + // + // Function specific stuff follows. + // +} NCP_REQUEST, *PNCP_REQUEST; + +// +// Header format for NCP request with a subfunction. +// + +typedef struct _NCP_REQUEST_WITH_SUB { + NCP_HEADER NcpHeader; + UCHAR FunctionCode; + USHORT SubfunctionLength; + UCHAR SubfunctionCode; + + // + // Function specific stuff follows. + // +} NCP_REQUEST_WITH_SUB, *PNCP_REQUEST_WITH_SUB; + +typedef struct _NCP_RESPONSE { + NCP_HEADER NcpHeader; + + UCHAR Error; + UCHAR Status; + + // + // Function specific stuff follows. + // + +} NCP_RESPONSE, *PNCP_RESPONSE; + +typedef struct _NCP_BURST_HEADER { + USHORT Command; // 0x7777 + UCHAR Flags; + UCHAR StreamType; // 0x02 + ULONG SourceConnection; + ULONG DestinationConnection; + ULONG PacketSequenceNo; + ULONG SendDelayTime; + USHORT BurstSequenceNo; + USHORT AckSequenceNo; + ULONG DataSize; + ULONG BurstOffset; + USHORT BurstLength; + USHORT MissingFragmentCount; +} NCP_BURST_HEADER, *PNCP_BURST_HEADER; + +typedef struct _NCP_BURST_WRITE_REQUEST { + NCP_BURST_HEADER BurstHeader; + ULONG Function; // 0x02 = Write + ULONG Handle; + ULONG TotalWriteOffset; + ULONG TotalWriteLength; + ULONG Offset; + ULONG Length; + //UCHAR Data[x]; +} NCP_BURST_WRITE_REQUEST, *PNCP_BURST_WRITE_REQUEST; + +typedef struct _NCP_BURST_READ_RESPONSE { + NCP_BURST_HEADER BurstHeader; + ULONG Result; + ULONG BytesRead; + //UCHAR Data[x]; +} NCP_BURST_READ_RESPONSE, *PNCP_BURST_READ_RESPONSE; + +typedef struct _NCP_BURST_READ_REQUEST { + NCP_BURST_HEADER BurstHeader; + ULONG Function; // 0x02 = Write + ULONG Handle; + ULONG TotalReadOffset; + ULONG TotalReadLength; + ULONG Offset; + ULONG Length; +} NCP_BURST_READ_REQUEST, *PNCP_BURST_READ_REQUEST; + +typedef struct _NCP_READ_REQUEST { + NCP_REQUEST RequestHeader; + UCHAR Unused; + UCHAR Handle[6]; + ULONG FileOffset; + USHORT Length; +} NCP_READ_REQUEST, *PNCP_READ_REQUEST; + +typedef struct _NCP_READ_RESPONSE { + NCP_RESPONSE ResponseHeader; + USHORT Length; + //UCHAR Data[x]; +} NCP_READ_RESPONSE, *PNCP_READ_RESPONSE; + +#include <packoff.h> + +#endif // _NCP_ + diff --git a/private/nw/inc/nds.h b/private/nw/inc/nds.h new file mode 100644 index 000000000..76728bcfb --- /dev/null +++ b/private/nw/inc/nds.h @@ -0,0 +1,226 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + Nds.h + +Abstract: + + This defines the necessary NDS data structures and + symbolic constants for both kernel and user mode + components. + +Author: + + Cory West [CoryWest] 08-Jan-1996 + +Revision History: + +--*/ + +// +// NDS Actions. +// + +#define NDS_REQUEST 104 // NCP Function Number. +#define NDS_PING 1 // Subfunction code for ping. +#define NDS_ACTION 2 // Subfunction code for action. + +// +// NDS Verb Numbers. +// + +#define NDSV_RESOLVE_NAME 1 +#define NDSV_READ_ENTRY_INFO 2 +#define NDSV_READ 3 +#define NDSV_LIST 5 +#define NDSV_OPEN_STREAM 27 +#define NDSV_GET_SERVER_ADDRESS 53 +#define NDSV_CHANGE_PASSWORD 55 +#define NDSV_BEGIN_LOGIN 57 +#define NDSV_FINISH_LOGIN 58 +#define NDSV_BEGIN_AUTHENTICATE 59 +#define NDSV_FINISH_AUTHENTICATE 60 +#define NDSV_LOGOUT 61 + +// +// Rounding Macros. +// + +#define ROUNDUP4(x) ( ( (x) + 3 ) & ( ~3 ) ) +#define ROUNDUP2(x) ( ( (x) + 1 ) & ( ~1 ) ) + +// +// Context Flags. +// + +#define FLAGS_DEREF_ALIASES 0x1 +#define FLAGS_XLATE_STRINGS 0x2 +#define FLAGS_TYPELESS_NAMES 0x4 +#define FLAGS_ASYNC_MODE 0x8 // Not supported. +#define FLAGS_CANONICALIZE_NAMES 0x10 +#define FLAGS_ALL_PUBLIC 0x1f + +// +// values for RESOLVE_NAME request flags +// + +#define RSLV_DEREF_ALIASES 0x40 +#define RSLV_READABLE 0x02 +#define RSLV_WRITABLE 0x04 +#define RSLV_WALK_TREE 0x20 +#define RSLV_CREATE_ID 0x10 +#define RSLV_ENTRY_ID 0x1 + +#define RESOLVE_NAME_ACCEPT_REMOTE 1 +#define RESOLVE_NAME_REFER_REMOTE 2 + +// +// Confidence Levels. +// + +#define LOW_CONF 0 +#define MED_CONF 1 +#define HIGH_CONF 2 + +// +// Referral Scopes. +// + +#define ANY_SCOPE 0 +#define COUNTRY_SCOPE 1 +#define ORGANIZATION_SCOPE 2 +#define LOCAL_SCOPE 3 + +// +// Max name sizes. +// + +#define MAX_NDS_SCHEMA_NAME_CHARS 32 + +#define MAX_NDS_NAME_CHARS 256 +#define MAX_NDS_NAME_SIZE ( MAX_NDS_NAME_CHARS * 2 ) +#define MAX_NDS_TREE_NAME_LEN 32 + +// +// For an NDS exchange, we use buffers of this size to hold the send +// and receive data. These sizes come from the Win95 implementation. +// + +#define NDS_BUFFER_SIZE 2048 +#define DUMMY_ITER_HANDLE ( ( unsigned long ) 0xffffffff ) +#define INITIAL_ITERATION ( ( unsigned long ) 0xffffffff ) +#define ENTRY_INFO_NAME_VALUE 1 + +// +// Various server responses. +// + +typedef struct { + + DWORD CompletionCode; + DWORD RemoteEntry; + DWORD EntryId; + DWORD ServerNameLength; + WCHAR ReferredServer[1]; + + // + // If RemoteEntry is set to RESOLVE_NAME_REFER_REMOTE, + // Then the tree server doesn't know the information + // about the object in question and has referred us to + // the server named in ReferredServer. + // + +} NDS_RESPONSE_RESOLVE_NAME, *PNDS_RESPONSE_RESOLVE_NAME; + +typedef struct { + + DWORD CompletionCode; + DWORD EntryFlags; + DWORD SubordinateCount; + DWORD ModificationTime; + + // + // Two UNICODE strings follow in standard NDS format: + // + // DWORD BaseClassLen; + // WCHAR BaseClass[BaseClassLen]; + // DWORD EntryNameLen; + // WCHAR EntryName[EntryNameLen]; + // + +} NDS_RESPONSE_GET_OBJECT_INFO, *PNDS_RESPONSE_GET_OBJECT_INFO; + +typedef struct { + + DWORD EntryId; + DWORD Flags; + DWORD SubordinateCount; + DWORD ModificationTime; + + // + // Two UNICODE strings follow in standard NDS format: + // + // DWORD BaseClassLen; + // WCHAR BaseClass[BaseClassLen]; + // DWORD EntryNameLen; + // WCHAR EntryName[EntryNameLen]; + // + +} NDS_RESPONSE_SUBORDINATE_ENTRY, *PNDS_RESPONSE_SUBORDINATE_ENTRY; + +typedef struct { + + DWORD CompletionCode; + DWORD IterationHandle; + DWORD SubordinateEntries; + + // + // Followed by an array of NDS_SUBORDINATE_ENTRY + // structures that is SubordinateEntries long. + // + +} NDS_RESPONSE_SUBORDINATE_LIST, *PNDS_RESPONSE_SUBORDINATE_LIST; + +typedef struct { + + DWORD SyntaxID; + DWORD AttribNameLength; + WCHAR AttribName[1]; + + // + // AttribName is of length + // AttribNameLength, of course. + // + + DWORD NumValues; + + // + // Followed by an array of NumValues + // Attrib structures. + // + +} NDS_ATTRIBUTE, *PNDS_ATTRIBUTE; + +typedef struct { + + DWORD CompletionCode; + DWORD IterationHandle; + DWORD InfoType; + DWORD NumAttributes; + + // + // Followed by an array of + // NDS_ATTRIBUTE structures. + // + +} NDS_RESPONSE_READ_ATTRIBUTE, *PNDS_RESPONSE_READ_ATTRIBUTE; + +typedef struct { + DWORD dwLength; + WCHAR Buffer[1]; +} NDS_STRING, *PNDS_STRING; + + diff --git a/private/nw/inc/ndsapi32.h b/private/nw/inc/ndsapi32.h new file mode 100644 index 000000000..57b55f890 --- /dev/null +++ b/private/nw/inc/ndsapi32.h @@ -0,0 +1,330 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + NdsLib32.h + +Abstract: + + This module exposes the minimal win32 API to Netware directory + services support in the Netware redirector. + +Author: + + Cory West [CoryWest] 23-Feb-1995 + +--*/ + +#include <nt.h> +#include <ntrtl.h> +#include <nturtl.h> +#include <windows.h> +#include <ntdef.h> + +#include <stdio.h> +#include <ntddnwfs.h> + +NTSTATUS +NwNdsOpenTreeHandle( + IN PUNICODE_STRING puNdsTree, + OUT PHANDLE phNwRdrHandle +); + +// NwNdsOpenTreeHandle( PUNICODE_STRING, PHANDLE ) +// +// Given an NDS tree name, this opens a handle the the redirector +// for accessing that tree. The handle should closed using the +// standard NT CloseHandle() call. This function is only a +// simple wrapper around NT OpenFile(). + +// +// Administrativa. +// + +#define HANDLE_TYPE_NCP_SERVER 1 +#define HANDLE_TYPE_NDS_TREE 2 + +NTSTATUS +NwNdsOpenGenericHandle( + IN PUNICODE_STRING puNdsTree, + OUT LPDWORD lpdwHandleType, + OUT PHANDLE phNwRdrHandle +); + +// NwNdsOpenGenericHandle( PUNICODE_STRING, LPDWORD, PHANDLE ) +// +// Given a name, this opens a handle the the redirector for accessing that +// named tree or server. lpdwHandleType is set to either HANDLE_TYPE_NCP_SERVER +// or HANDLE_TYPE_NDS_TREE accordingly. The handle should be closed using +// the standard NT CloseHandle() call. This function is only a simple +// wrapper around NT OpenFile(). + +NTSTATUS +NwOpenHandleWithSupplementalCredentials( + IN PUNICODE_STRING puResourceName, + IN PUNICODE_STRING puUserName, + IN PUNICODE_STRING puPassword, + OUT LPDWORD lpdwHandleType, + OUT PHANDLE phNwHandle +); + +// NwOpenHandleWithSupplementalCredentials +// +// Given a resource name (either a server name or a tree name), +// open a handle to that resource with the provided username and +// password. As with the open generic handle routine, lpdsHandleType +// will be set to either HANDLE_TYPE_NCP_SERVER or +// HANDLE_TYPE_NDS_TREE based on the result of the open. + +// +// Administrativa. +// + +NTSTATUS +NwNdsSetTreeContext ( + IN HANDLE hNdsRdr, + IN PUNICODE_STRING puTree, + IN PUNICODE_STRING puContext +); + +// NwNdsSetTreeContext(HANDLE, PUNICODE_STRING, PUNICODE_STRING) +// +// Set the current context for the specified tree. +// +// Arguments: +// +// HANDLE hNdsRdr - A handle to the redirector. +// PUNICODE_STRING puTree - The tree name. +// PUNICODE_STRING puContext - The context in that tree. + +NTSTATUS +NwNdsGetTreeContext ( + IN HANDLE hNdsRdr, + IN PUNICODE_STRING puTree, + OUT PUNICODE_STRING puContext +); + +// NwNdsGetTreeContext(HANDLE, PUNICODE_STRING, PUNICODE_STRING) +// +// Get the current context for the specified tree. +// +// Arguments: +// +// HANDLE hNdsRdr - A handle to the redirector. +// PUNICODE_STRING puTree - The tree name. +// PUNICODE_STRING puContext - The context in that tree. + +// +// Browsing and Navigating support. +// + +NTSTATUS +NwNdsResolveName ( + IN HANDLE hNdsTree, + IN PUNICODE_STRING puObjectName, + OUT DWORD *dwObjectId, + OUT PUNICODE_STRING puReferredServer, + OUT PBYTE pbRawResponse, + IN DWORD dwResponseBufferLen +); + +// NwNdsResolveName(HANDLE, PUNICODE_STRING, PDWORD) +// +// Resolve the given name to an NDS object id. This utilizes +// NDS verb 1. +// +// There is currently no interface for canonicalizing names. +// This call will use the default context if one has been set +// for this NDS tree. +// +// puReferredServer must point to a UNICODE_STRING with enough +// space to hold a server name (MAX_SERVER_NAME_LENGTH) * +// sizeof( WCHAR ). +// +// If dwResponseBufferLen is not 0, and pbRawResponse points +// to a writable buffer of length dwResponseBufferLen, then +// this routine will also return the entire NDS response in +// the raw response buffer. The NDS response is described +// by NDS_RESPONSE_RESOLVE_NAME. +// +// Arguments: +// +// HANDLE hNdsTree - The name of the NDS tree that we are interested in looking into. +// PUNICODE_STRING puObjectName - The name that we want resolved into an object id. +// DWORD *dwObjectId - The place where we will place the object id. +// BYTE *pbRawResponse - The raw response buffer, if desired. +// DWORD dwResponseBufferLen - The length of the raw response buffer. + +NTSTATUS +NwNdsList ( + IN HANDLE hNdsTree, + IN DWORD dwObjectId, + OUT DWORD *dwIterHandle, + OUT BYTE *pbReplyBuf, + IN DWORD dwReplyBufLen +); + +// NwNdsList(HANDLE, DWORD, PDWORD, PBYTE, DWORD, PDWORD) +// +// List the immediate subordinates of an object. This utilizes +// NDS verb 5. +// +// Arguments: +// +// HANDLE hNdsTree - The handle to the tree that we are interested in. +// DWORD dwObjectId - The object that we want to list. +// DWORD *dwIterHandle - The iteration handle to be used in continuing +// the request if the buffer is not large enough for the entire +// list of subordinates. +// BYTE *pbReplyBuf - The buffer where the raw reply will be placed. +// DWORD dwReplyBufLen - The length of the raw reply buffer. + +NTSTATUS +NwNdsReadObjectInfo( + IN HANDLE hNdsTree, + IN DWORD dwObjectId, + OUT PBYTE pbReplyBuf, + IN DWORD dwReplyBufLen +); + +// NwNdsReadObjectInfo(PUNICODE_STRING, DWORD, PBYTE, DWORD) +// +// Given an object id, this gets the basic info for the object. This +// utilizes NDS verb 2. The reply buffer should be large enough to +// hold a DS_OBJ_INFO struct and the text of the two unicode strings. +// +// Arguments: +// +// HANDLE hNdsTree - The tree that we want to look in. +// DWORD dwObjectId - The object id that we want to learn about. +// BYTE *pbReplyBuf - The space for the reply. +// DWORD dwReplyBufLen - The length of the reply buffer. + +NTSTATUS +NwNdsReadAttribute ( + IN HANDLE hNdsTree, + IN DWORD dwObjectId, + IN DWORD *dwIterHandle, + IN PUNICODE_STRING puAttrName, + OUT BYTE *pbReplyBuf, + IN DWORD dwReplyBufLen +); + +// NwNdsReadAttribute(HANDLE, DWORD, PDWORD, PUNICODE_STRING, PBYTE, DWORD) +// +// Read the requested attribute from the listed object. +// This utilizes NDS verb 3. +// +// Arguments: +// +// HANDLE hNdsTree - The tree that we want to read from. +// DWORD dwObjectId - The object that we want to read from. +// DWORD *dwIterHandle - The iteration handle. +// PUNICODE_STRING puAttrName - The name of the attribute. +// BYTE *pbReplyBuf - The buffer to hold the response. +// DWORD deReplyBufLen - The length of the reply buffer. + +NTSTATUS +NwNdsOpenStream ( + IN HANDLE hNdsTree, + IN DWORD dwObjectId, + IN PUNICODE_STRING puStreamName, + IN DWORD dwOpenFlags, + OUT DWORD *pdwFileLength +); + +// NwNdsOpenStream(HANDLE, DWORD, PBYTE, DWORD) +// +// Open a file handle to the stream listed. +// This utilizes NDS verb 27. +// +// Arguments: +// +// HANDLE hNdsTree - The handle to the NDS tree that we are interested in. +// DWORD dwObjectId - The object id that we want to query. +// PUNICODE_STRING puStreamName - The name of the stream that we want to open. +// DWORD dwOpenFlags - 1 for read, 2 for write, 3 for read/write. +// DWORD *pdwFileLength - The length of the file stream. + +NTSTATUS +NwNdsGetQueueInformation( + IN HANDLE hNdsTree, + IN PUNICODE_STRING puQueueName, + OUT PUNICODE_STRING puHostServer, + OUT PDWORD pdwQueueId +); + +// NwNdsGetQueueInformation(HANDLE, PUNICODE_STRING, PUNICODE_STRING, PDWORD) +// +// Arguments: +// +// HANDLE hNdsTree - The handle to the NDS tree that knows about the queue. +// PUNICODE_STRING puQueueName - The ds path to the queue that we want. +// PUNICODE_STRING puHostServer - The host server for this queue. +// PDWORD pdwQueueId - The queue id for this queue on this server. + +NTSTATUS +NwNdsGetVolumeInformation( + IN HANDLE hNdsTree, + IN PUNICODE_STRING puVolumeName, + OUT PUNICODE_STRING puHostServer, + OUT PUNICODE_STRING puHostVolume +); + +// NwNdsGetVoluemInformation(HANDLE, PUNICODE_STRING, PUNICODE_STRING, PUNICODE_STRING) +// +// Arguments: +// +// HANDLE hNdsTree - The handle to the NDS tree that knows about the volume. +// PUNICODE_STRING puVolumeName - The ds path to the volume that we want. +// PUNICODE_STRING puHostServer - The host server for this nds volume. +// PUNICODE_STRING puHostVolume - The host volume for this nds volume. + +// +// User mode fragment exchange. +// + +NTSTATUS +_cdecl +FragExWithWait( + IN HANDLE hNdsServer, + IN DWORD NdsVerb, + IN BYTE *pReplyBuffer, + IN DWORD pReplyBufferLen, + IN OUT DWORD *pdwReplyLen, + IN BYTE *NdsRequestStr, + ... +); + +NTSTATUS +_cdecl +ParseResponse( + PUCHAR Response, + ULONG ResponseLength, + char* FormatString, + ... +); + +int +_cdecl +FormatBuf( + char *buf, + int bufLen, + const char *format, + va_list args +); + +// +// Change password support. +// + +NTSTATUS +NwNdsChangePassword( + IN HANDLE hNwRdr, + IN PUNICODE_STRING puTreeName, + IN PUNICODE_STRING puUserName, + IN PUNICODE_STRING puCurrentPassword, + IN PUNICODE_STRING puNewPassword +); diff --git a/private/nw/inc/ntddnwfs.h b/private/nw/inc/ntddnwfs.h new file mode 100644 index 000000000..28fe63515 --- /dev/null +++ b/private/nw/inc/ntddnwfs.h @@ -0,0 +1,625 @@ +/*++ BUILD Version: 0009 // Increment this if a change has global effects + +Copyright (c) 1987-1993 Microsoft Corporation + +Module Name: + + ntddnwfs.h + +Abstract: + + This is the include file that defines all constants and types for + accessing the NetWare redirector file system device. + +Author: + + Colin Watson (ColinW) 23-Dec-1992 + +Revision History: + + +--*/ + +#ifndef _NTDDNWFS_ +#define _NTDDNWFS_ + +#include <windef.h> +#include <winnetwk.h> // NETRESOURCE structure + +typedef CHAR SERVERNAME[48]; +typedef SERVERNAME* PSERVERNAME; + +// +// Device Name - this string is the name of the device. It is the name +// that should be passed to NtOpenFile when accessing the device. +// +// Note: For devices that support multiple units, it should be suffixed +// with the Ascii representation of the unit number. +// + +#define DD_NWFS_DEVICE_NAME "\\Device\\NwRdr" +#define DD_NWFS_DEVICE_NAME_U L"\\Device\\NwRdr" + +// +// The file system name as returned by +// NtQueryInformationVolume(FileFsAttributeInformation) +// +#define DD_NWFS_FILESYS_NAME "NWRDR" +#define DD_NWFS_FILESYS_NAME_U L"NWRDR" + +// +// Connection type bit mask +// +#define CONNTYPE_DISK 0x00000001 +#define CONNTYPE_PRINT 0x00000002 +#define CONNTYPE_ANY ( CONNTYPE_DISK | CONNTYPE_PRINT ) +#define CONNTYPE_IMPLICIT 0x80000000 +#define CONNTYPE_SYMBOLIC 0x40000000 + +// +// EA Names for creating a connection +// +#define EA_NAME_USERNAME "UserName" +#define EA_NAME_PASSWORD "Password" +#define EA_NAME_TYPE "Type" +#define EA_NAME_CREDENTIAL_EX "ExCredentials" + +#define TRANSACTION_REQUEST 0x00000003 + + +// +// NtDeviceIoControlFile/NtFsControlFile IoControlCode values for this device. +// +// Warning: Remember that the low two bits of the code specify how the +// buffers are passed to the driver! +// +// +// Method = 00 - Buffer both input and output buffers for the request +// Method = 01 - Buffer input, map output buffer to an MDL as an IN buff +// Method = 10 - Buffer input, map output buffer to an MDL as an OUT buff +// Method = 11 - Do not buffer either the input or output +// + +#define IOCTL_NWRDR_BASE FILE_DEVICE_NETWORK_FILE_SYSTEM + +#define _NWRDR_CONTROL_CODE(request, method, access) \ + CTL_CODE(IOCTL_NWRDR_BASE, request, method, access) + +#define FSCTL_NWR_START _NWRDR_CONTROL_CODE(200, METHOD_IN_DIRECT, FILE_ANY_ACCESS) +#define FSCTL_NWR_STOP _NWRDR_CONTROL_CODE(201, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_NWR_LOGON _NWRDR_CONTROL_CODE(202, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_NWR_LOGOFF _NWRDR_CONTROL_CODE(203, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_NWR_GET_CONNECTION _NWRDR_CONTROL_CODE(204, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_NWR_ENUMERATE_CONNECTIONS _NWRDR_CONTROL_CODE(205, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_NWR_DELETE_CONNECTION _NWRDR_CONTROL_CODE(207, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_NWR_BIND_TO_TRANSPORT _NWRDR_CONTROL_CODE(208, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_NWR_CHANGE_PASS _NWRDR_CONTROL_CODE(209, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_NWR_SET_INFO _NWRDR_CONTROL_CODE(211, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define FSCTL_NWR_GET_USERNAME _NWRDR_CONTROL_CODE(215, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_NWR_CHALLENGE _NWRDR_CONTROL_CODE(216, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_NWR_GET_CONN_DETAILS _NWRDR_CONTROL_CODE(217, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_NWR_GET_MESSAGE _NWRDR_CONTROL_CODE(218, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_NWR_GET_STATISTICS _NWRDR_CONTROL_CODE(219, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_NWR_GET_CONN_STATUS _NWRDR_CONTROL_CODE(220, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_NWR_GET_CONN_INFO _NWRDR_CONTROL_CODE(221, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_NWR_GET_PREFERRED_SERVER _NWRDR_CONTROL_CODE(222, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_NWR_GET_CONN_PERFORMANCE _NWRDR_CONTROL_CODE(223, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_NWR_SET_SHAREBIT _NWRDR_CONTROL_CODE(224, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define FSCTL_NWR_NDS_SETCONTEXT NWR_ANY_NDS(1) +#define FSCTL_NWR_NDS_GETCONTEXT NWR_ANY_NDS(2) +#define FSCTL_NWR_NDS_VERIFY_TREE NWR_ANY_NDS(3) +#define FSCTL_NWR_NDS_RESOLVE_NAME NWR_ANY_NDS(4) +#define FSCTL_NWR_NDS_LIST_SUBS NWR_ANY_NDS(5) +#define FSCTL_NWR_NDS_READ_INFO NWR_ANY_NDS(6) +#define FSCTL_NWR_NDS_READ_ATTR NWR_ANY_NDS(7) +#define FSCTL_NWR_NDS_OPEN_STREAM NWR_ANY_NDS(8) +#define FSCTL_NWR_NDS_GET_QUEUE_INFO NWR_ANY_NDS(9) +#define FSCTL_NWR_NDS_GET_VOLUME_INFO NWR_ANY_NDS(10) +#define FSCTL_NWR_NDS_RAW_FRAGEX NWR_ANY_NDS(11) +#define FSCTL_NWR_NDS_CHANGE_PASS NWR_ANY_NDS(12) +#define FSCTL_NWR_NDS_LIST_TREES NWR_ANY_NDS(13) + +#define IOCTL_NWR_RAW_HANDLE _NWRDR_CONTROL_CODE(1002,METHOD_NEITHER, FILE_ANY_ACCESS) + +// +// UserNcp control code definitions. The parameter (X) to NWR_ANY_NCP +// is the function code to be placed in the NCP. +// + +#define NWR_ANY_NCP(X) _NWRDR_CONTROL_CODE(0x400 | (X), METHOD_NEITHER, FILE_ANY_ACCESS) +#define NWR_ANY_F2_NCP(X) _NWRDR_CONTROL_CODE(0x500 | (X), METHOD_NEITHER, FILE_ANY_ACCESS) +#define NWR_ANY_HANDLE_NCP(X) _NWRDR_CONTROL_CODE(0x600 | (X), METHOD_NEITHER, FILE_ANY_ACCESS) +#define NWR_ANY_NDS(X) _NWRDR_CONTROL_CODE(0x700 | (X), METHOD_NEITHER, FILE_ANY_ACCESS) + +#define FSCTL_NWR_NCP_E3H NWR_ANY_NCP(0x17) +#define FSCTL_NWR_NCP_E2H NWR_ANY_NCP(0x16) +#define FSCTL_NWR_NCP_E1H NWR_ANY_NCP(0x15) +#define FSCTL_NWR_NCP_E0H NWR_ANY_NCP(0x14) + +// +// Macro for obtaining the parameter given to NWR_ANY_XXX when creating +// a control code to send a UserNcp to the redirector. +// + +#define ANY_NCP_OPCODE(X) ((UCHAR)(((X) >> 2) & 0x00ff)) + +// +// Macro to give the command type +// + +#define IS_IT_NWR_ANY_NCP(X) ((X & 0x1C00) == (0x400 << 2)) +#define IS_IT_NWR_ANY_F2_NCP(X) ((X & 0x1C00) == (0x500 << 2)) +#define IS_IT_NWR_ANY_HANDLE_NCP(X) ((X & 0x1C00) == (0x600 << 2)) + +// +// Redirector Request Packet used by the Workstation service +// to pass parameters to the Redirector through Buffer 1 of +// NtFsControlFile. +// +// Additional output of each FSCtl is found in Buffer 2. +// + +#define REQUEST_PACKET_VERSION 0x00000001L // Structure version. + +typedef struct _NWR_REQUEST_PACKET { + + ULONG Version; // Version of structure in Buffer 2 + + union { + + + // + // For FSCTL_NWR_BIND_TO_TRANSPORT + // + struct { + ULONG QualityOfService; // Quality of service indicator IN + ULONG TransportNameLength; // Not including terminator IN + WCHAR TransportName[1]; // Name of transport provider IN + } Bind; + + + // + // For FSCTL_NWR_LOGON + // + struct { + LUID LogonId; // User logon session identifier IN + ULONG UserNameLength; // Byte count not including NULL IN + ULONG PasswordLength; // Byte count not including NULL IN + ULONG ServerNameLength; // Byte count not including NULL IN + ULONG ReplicaAddrLength; // IPX address of the nearest dir server + // replica (for NDS login only). + // It's either sizeof(TDI_ADDRESS_IPX) + // or 0. IN + + WCHAR UserName[1]; // User name not NULL terminated. IN + + // Password string // Default password for connection, + // not NULL terminated, packed + // in buffer immediately after + // UserName. IN + + // ServerName // Preferred server name packed in + // buffer immediately after + // Password. IN + + // IpxAddress // Address copied from the SAP response + // packet, packed immediately after + // the servername. IN + } Logon; + + // + // For FSCTL_NWR_CHANGE_PASS + // + struct { + + ULONG UserNameLength; + ULONG PasswordLength; + ULONG ServerNameLength; + WCHAR UserName[1]; + + // Password string // New password. IN + + // ServerName // Server with the new password IN + + } ChangePass; + + // + // For FSCTL_NWR_LOGOFF + // + struct { + LUID LogonId; // User logon session identifier IN + } Logoff; + + // + // For FSCTL_NWR_DELETE_CONNECTION + // + struct { + BOOLEAN UseForce; // Force flag IN + } DeleteConn; + + // + // For FSCTL_NWR_GET_CONNECTION + // + struct { + ULONG BytesNeeded; // Size (byte count) required of + // output buffer including + // terminator OUT + ULONG DeviceNameLength; // Not including terminator IN + WCHAR DeviceName[4]; // Name of DOS device IN + } GetConn; + + // + // FSCTL_NWR_ENUMERATE_CONNECTIONS + // + struct { + ULONG EntriesRequested; // Number of entries to get IN + ULONG EntriesReturned; // Entries returned in respose buf OUT + ULONG ResumeKey; // Handle to next entry to get IN OUT + ULONG BytesNeeded; // Size (byte count) of next entry OUT + ULONG ConnectionType; // Resource type requested IN + } EnumConn; + + // + // FSCTL_NWR_SET_INFO + // + struct { + ULONG PrintOption; + ULONG MaximumBurstSize; + + ULONG PreferredServerLength; // Byte count not including NULL IN + ULONG ProviderNameLength; // Byte count not including NULL IN + WCHAR PreferredServer[1]; // Preferred server name not NULL + // terminated. + // ProviderName string // Provider name not NULL terminated. + // Packed in buffer immediately + // after PreferredServer + + } SetInfo; + + // + // FSCTL_NWR_GET_CONN_STATUS + // + struct { + ULONG ConnectionNameLength; // IN: Length of the connection name we want. + ULONG ResumeKey; // IN: Resume key for a continued request. + ULONG EntriesReturned; // OUT: Entries returned in respose buffer. + ULONG BytesNeeded; // OUT: Size (byte count) of next entry. + WCHAR ConnectionName[1]; // IN: Connection name described above. + } GetConnStatus; + + // + // FSCTL_NWR_GET_CONN_INFO + // + struct { + ULONG ConnectionNameLength; // IN: Length of the connection name we want. + WCHAR ConnectionName[1]; // IN: Connection name described above. + } GetConnInfo; + + // + // FSCTL_NWR_GET_CONN_PERFORMANCE + // + struct { + + // + // These are the fields for the NETCONNECTINFOSTRUCT. + // + + DWORD dwFlags; + DWORD dwSpeed; + DWORD dwDelay; + DWORD dwOptDataSize; + + // + // This is the remote name in question. + // + + ULONG RemoteNameLength; + WCHAR RemoteName[1]; + } GetConnPerformance; + + struct { + ULONG DebugFlags; // Value for NwDebug + } DebugValue; + + } Parameters; + +} NWR_REQUEST_PACKET, *PNWR_REQUEST_PACKET; + +typedef struct _NWR_NDS_REQUEST_PACKET { + + // + // Version of structure in Buffer 2. + // + + ULONG Version; + + union { + + // + // For FSCTL_NWR_NDS_RESOLVE_NAME + // + + struct { + ULONG ObjectNameLength; // IN + DWORD ResolverFlags; // IN + DWORD BytesWritten; // OUT + WCHAR ObjectName[1]; // IN + } ResolveName; + + // + // For FSCTL_NWR_NDS_READ_INFO + // + + struct { + DWORD ObjectId; // IN + DWORD BytesWritten; // OUT + } GetObjectInfo; + + // + // For FSCTL_NWR_NDS_LIST_SUBS + // + + struct { + DWORD ObjectId; // IN + DWORD IterHandle; // IN + DWORD BytesWritten; // OUT + } ListSubordinates; + + // + // For FSCTL_NWR_NDS_READ_ATTR + // + + struct { + DWORD ObjectId; // IN + DWORD IterHandle; // IN + DWORD BytesWritten; // OUT + DWORD AttributeNameLength; // IN + WCHAR AttributeName[1]; // IN + } ReadAttribute; + + // + // For FSCTL_NWR_NDS_OPEN_STREAM + // + + struct { + DWORD FileLength; // OUT + DWORD StreamAccess; // IN + DWORD ObjectOid; // IN + UNICODE_STRING StreamName; // IN + WCHAR StreamNameString[1]; // IN + } OpenStream; + + // + // For FSCTL_NWR_NDS_SET_CONTEXT + // + + struct { + DWORD TreeNameLen ; // IN + DWORD ContextLen; // IN + WCHAR TreeAndContextString[1]; // IN + } SetContext; + + // + // For FSCTL_NWR_NDS_GET_CONTEXT + // + + struct { + UNICODE_STRING Context; // OUT + DWORD TreeNameLen ; // IN + WCHAR TreeNameString[1]; // IN + } GetContext; + + // + // For FSCTL_NWR_NDS_VERIFY_TREE + // + + struct { + UNICODE_STRING TreeName; // IN + WCHAR NameString[1]; // IN + } VerifyTree; + + // + // For FSCTL_NWR_NDS_GET_QUEUE_INFO + // + + struct { + UNICODE_STRING QueueName; // IN + UNICODE_STRING HostServer; // OUT + DWORD QueueId; // OUT + } GetQueueInfo; + + // + // For FSCTL_NWR_NDS_GET_VOLUME_INFO + // + + struct { + DWORD ServerNameLen; // OUT + DWORD TargetVolNameLen; // OUT + DWORD VolumeNameLen; // IN + WCHAR VolumeName[1]; // IN + } GetVolumeInfo; + + // + // For FSCTL_NWR_NDS_RAW_FRAGEX + // + + struct { + DWORD NdsVerb; // IN + DWORD RequestLength; // IN + DWORD ReplyLength; // OUT + BYTE Request[1]; // IN + } RawRequest; + + // + // For FSCTL_NWR_NDS_CHANGE_PASS + // + + struct { + + DWORD NdsTreeNameLength; + DWORD UserNameLength; + DWORD CurrentPasswordLength; + DWORD NewPasswordLength; + + // + // The above strings should be end to + // end starting at StringBuffer. + // + + WCHAR StringBuffer[1]; + } ChangePass; + + // + // For FSCTL_NWR_NDS_LIST_TREES + // + + struct { + + DWORD NtUserNameLength; // IN + LARGE_INTEGER UserLuid; // OUT + DWORD TreesReturned; // OUT + WCHAR NtUserName[1]; // IN + } ListTrees; + + } Parameters; + +} NWR_NDS_REQUEST_PACKET, *PNWR_NDS_REQUEST_PACKET; + +// +// Structure of buffer 2 for FSCTL_NWR_GET_CONNECTION +// +typedef struct _NWR_SERVER_RESOURCE { + WCHAR UncName[1]; // Server resource name DOS device + // is connected to; NULL terminated +} NWR_SERVER_RESOURCE, *PNWR_SERVER_RESOURCE; + +// +// Structure of buffer for FSCTL_NWR_GET_MESSAGE +// + +typedef struct _NWR_SERVER_MESSAGE { + ULONG MessageOffset; // Offset from start of buffer to message + WCHAR Server[1]; // Source of message, NUL terminated OUT + //WCHAR Message[]; // The message text, NUL terminated OUT +} NWR_SERVER_MESSAGE, *PNWR_SERVER_MESSAGE; + +#define TRANSACTION_VERSION 0x00000001L // Structure version. +typedef struct _NWR_TRANSACTION { + ULONG Type; // Type of structure + ULONG Size; // Size of fixed portion of structure + ULONG Version; // Structure version. + ULONG NameLength; // Number of bytes in name (in path + // format, e.g., \server\pipe\netapi\4) + ULONG NameOffset; // Offset of name in buffer. + BOOLEAN ResponseExpected; // Should remote system respond? + ULONG Timeout; // Timeout time in milliseconds. + ULONG SetupWords; // Number of trans setup words (may be + // 0). (setup words are input/output.) + ULONG SetupOffset; // Offset of setup (may be 0 for none). + ULONG MaxSetup; // Size of setup word array (may be 0). + ULONG ParmLength; // Input param area length (may be 0). + PVOID ParmPtr; // Input parameter area (may be NULL). + ULONG MaxRetParmLength; // Output param. area length (may be 0). + ULONG DataLength; // Input data area length (may be 0). + PVOID DataPtr; // Input data area (may be NULL). + ULONG MaxRetDataLength; // Output data area length (may be 0). + PVOID RetDataPtr; // Output data area (may be NULL). +} NWR_TRANSACTION, *PNWR_TRANSACTION; + +typedef struct _NWR_GET_CONNECTION_DETAILS { + SERVERNAME ServerName; + UCHAR OrderNumber; // Position in the Scb chain starting at 1 + UCHAR ServerAddress[12]; + UCHAR ConnectionNumberLo; + UCHAR ConnectionNumberHi; + UCHAR MajorVersion; + UCHAR MinorVersion; + BOOLEAN Preferred; +} NWR_GET_CONNECTION_DETAILS, *PNWR_GET_CONNECTION_DETAILS; + +typedef struct _NWR_GET_USERNAME { + WCHAR UserName[1]; +} NWR_GET_USERNAME, *PNWR_GET_USERNAME; + +typedef struct _NWR_GET_CHALLENGE_REQUEST { + ULONG Flags; + ULONG ObjectId; + UCHAR Challenge[8]; + ULONG ServerNameorPasswordLength; + WCHAR ServerNameorPassword[1]; // No NULL +} NWR_GET_CHALLENGE_REQUEST, *PNWR_GET_CHALLENGE_REQUEST; + +#define CHALLENGE_FLAGS_SERVERNAME 0 +#define CHALLENGE_FLAGS_PASSWORD 1 + +typedef struct _NWR_GET_CHALLENGE_REPLY { + UCHAR Challenge[8]; +} NWR_GET_CHALLENGE_REPLY, *PNWR_GET_CHALLENGE_REPLY; + +// +// Fields marked FIXFIX are not updated. Remove or record... +// +typedef struct _NW_REDIR_STATISTICS { + LARGE_INTEGER StatisticsStartTime; + + LARGE_INTEGER BytesReceived; + LARGE_INTEGER NcpsReceived; + + LARGE_INTEGER BytesTransmitted; + LARGE_INTEGER NcpsTransmitted; + + ULONG ReadOperations; + ULONG RandomReadOperations; //FIXFIX + ULONG ReadNcps; + ULONG PacketBurstReadNcps; + ULONG PacketBurstReadTimeouts; + + ULONG WriteOperations; + ULONG RandomWriteOperations; //FIXFIX + ULONG WriteNcps; + ULONG PacketBurstWriteNcps; + ULONG PacketBurstWriteTimeouts; + + // Connection/Session counts + ULONG Sessions; + ULONG FailedSessions; + ULONG Reconnects; + ULONG NW2xConnects; //FIXFIX + ULONG NW3xConnects; //FIXFIX + ULONG NW4xConnects; //FIXFIX + ULONG ServerDisconnects; + + ULONG CurrentCommands; +} NW_REDIR_STATISTICS, *PNW_REDIR_STATISTICS; + +// +// CONN_STATUS structures for the new shell. +// + +typedef struct _CONN_STATUS { + DWORD dwTotalLength; // The total length including packed strings. + LPWSTR pszServerName; // The server name. + LPWSTR pszUserName; // The user name. + LPWSTR pszTreeName; // The tree name or NULL for a 2.x or 3.x server. + DWORD nConnNum; // The connection number used on nw srv. + BOOL fNds; // TRUE if NDS, False for Bindery servers + BOOL fPreferred; // TRUE if the connection is a preferred server with no explicit uses. + DWORD dwConnType; // Authentication status of the connection. +} CONN_STATUS, *PCONN_STATUS; + +#define NW_CONN_NOT_AUTHENTICATED 0x00000000 +#define NW_CONN_BINDERY_LOGIN 0x00000001 +#define NW_CONN_NDS_AUTHENTICATED_NO_LICENSE 0x00000002 +#define NW_CONN_NDS_AUTHENTICATED_LICENSED 0x00000003 +#define NW_CONN_DISCONNECTED 0x00000004 + +typedef struct _CONN_INFORMATION { + DWORD HostServerLength; + LPWSTR HostServer; + DWORD UserNameLength; + LPWSTR UserName; +} CONN_INFORMATION, *PCONN_INFORMATION; + +#endif // ifndef _NTDDNWFS_ diff --git a/private/nw/inc/nwapi.h b/private/nw/inc/nwapi.h new file mode 100644 index 000000000..2b34f27b7 --- /dev/null +++ b/private/nw/inc/nwapi.h @@ -0,0 +1,197 @@ +/*++ + +Copyright (c) 1993 Microsoft Corporation + +Module Name: + + api.h + +Abstract: + + This module contains exposed APIs that is used by the + NetWare Control Panel Applet. + +Author: + + Yi-Hsin Sung 15-Jul-1993 + +Revision History: + +--*/ + +#ifndef _NWAPI_INCLUDED_ +#define _NWAPI_INCLUDED_ + +#include <nwcons.h> + +// +// Bitmask for print options +// + +#define NW_PRINT_SUPPRESS_FORMFEED 0x08 +#define NW_PRINT_PRINT_BANNER 0x80 +#define NW_PRINT_PRINT_NOTIFY 0x10 + +// +// Flags for logon script support. +// + +#define NW_LOGONSCRIPT_DISABLED 0x00000000 +#define NW_LOGONSCRIPT_ENABLED 0x00000001 +#define NW_LOGONSCRIPT_4X_ENABLED 0x00000002 +#define NW_LOGONSCRIPT_DEFAULT NW_LOGONSCRIPT_DISABLED +#define NW_LOGONSCRIPT_DEBUG 0x00000800 + +// +// Values for turning on Sync login script flags. +// + +#define SYNC_LOGONSCRIPT 0x1 +#define RESET_SYNC_LOGONSCRIPT 0x2 + +// +// Bitmask for gateway redirections +// +#define NW_GW_UPDATE_REGISTRY 0x01 +#define NW_GW_CLEANUP_DELETED 0x02 + + +DWORD +NwQueryInfo( + OUT PDWORD pnPrintOption, + OUT LPWSTR *ppszPreferredSrv + ); + +DWORD +NwSetInfoInRegistry( + IN DWORD nPrintOption, + IN LPWSTR pszPreferredSrv + ); + +DWORD +NwSetLogonOptionsInRegistry( + IN DWORD nLogonScriptOptions + ); + +DWORD +NwQueryLogonOptions( + OUT PDWORD pnLogonScriptOptions + ); + +DWORD +NwSetInfoInWksta( + IN DWORD nPrintOption, + IN LPWSTR pszPreferredSrv + ); + +DWORD +NwSetLogonScript( + IN DWORD ScriptOptions + ); + +DWORD +NwValidateUser( + IN LPWSTR pszPreferredSrv +); + +DWORD +NwEnumGWDevices( + LPDWORD Index, + LPBYTE Buffer, + DWORD BufferSize, + LPDWORD BytesNeeded, + LPDWORD EntriesRead + ) ; + +DWORD +NwAddGWDevice( + LPWSTR DeviceName, + LPWSTR RemoteName, + LPWSTR AccountName, + LPWSTR Password, + DWORD Flags + ) ; + +DWORD +NwDeleteGWDevice( + LPWSTR DeviceName, + DWORD Flags + ) ; + +DWORD +NwEnumConnections( + HANDLE hEnum, + LPDWORD lpcCount, + LPVOID lpBuffer, + LPDWORD lpBufferSize, + BOOL fImplicitConnections + ); + +DWORD +NwLibSetEverybodyPermission( + HKEY hKey, + DWORD dwAccessPermission + ); + +DWORD +NwQueryGatewayAccount( + LPWSTR AccountName, + DWORD AccountNameLen, + LPDWORD AccountCharsNeeded, + LPWSTR Password, + DWORD PasswordLen, + LPDWORD PasswordCharsNeeded + ); + +DWORD +NwSetGatewayAccount( + LPWSTR AccountName, + LPWSTR Password + ); + +DWORD +NwLogonGatewayAccount( + LPWSTR AccountName, + LPWSTR Password, + LPWSTR Server + ); + +DWORD +NwRegisterGatewayShare( + IN LPWSTR ShareName, + IN LPWSTR DriveName + ); + +DWORD +NwClearGatewayShare( + IN LPWSTR ShareName + ); + +DWORD +NwCleanupGatewayShares( + VOID + ); + + +VOID +MapSpecialJapaneseChars( + LPSTR lpszA, + WORD length + ); + +VOID +UnmapSpecialJapaneseChars( + LPSTR lpszA, + WORD length + ); + +LPSTR +NwDupStringA( + const LPSTR lpszA, + WORD length + ); + +#define NwFreeStringA(lp) if((lp) != NULL) { (void)LocalFree((lp)); } + + +#endif diff --git a/private/nw/inc/nwapi32.h b/private/nw/inc/nwapi32.h new file mode 100644 index 000000000..d31dbfc81 --- /dev/null +++ b/private/nw/inc/nwapi32.h @@ -0,0 +1,810 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 1993 Microsoft Corporation +// +// Module Name: +// +// nwapi32.h +// +// Abstract: +// +// This module contains the support for calls into CSNW. +// +// Author: +// +// Chris Sandys (a-chrisa) 09-Sep-1993 +// +// Revision History: +// Chuck Y Chan Feb 3, 1994 Make it NT like +// Chuck Y Chan Feb 4, 1996 Merged in calls used by DSMN (from +// nwcapi32.h) +// +////////////////////////////////////////////////////////////////////////////// + + +#ifndef _NWAPI32_H_ +#define _NWAPI32_H_ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +// +// Order of Funtions +// +// NWAddTrusteeToDirectory +// NWAllocTemporaryDirectoryHandle +// NWAllocPermanentDirectoryHandle +// NWAttachToFileServer +// NWCheckConsolePrivileges +// NWDeallocateDirectoryHandle +// NWDetachFromFileServer +// NWGetFileServerVersionInfo +// NWGetInternetAddress +// NWGetObjectName +// NWGetVolumeInfoWithHandle +// NWGetVolumeInfoWithNumber +// NWGetVolumeName +// NWIsObjectInSet +// NWLoginToFileServer +// NWLogoutFromFileServer +// NWReadPropertyValue +// NWScanObject +// NWScanProperty + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Manifests and structures // +// // +/////////////////////////////////////////////////////////////////////////////// + +// +// Version Structure +// +#include <packon.h> + +typedef struct _VERSION_INFO { + BYTE szName[48]; + BYTE Version; + BYTE SubVersion; + WORD ConnsSupported; + WORD connsInUse; + WORD maxVolumes; + BYTE OSRev; + BYTE SFTLevel; + BYTE TTSLevel; + WORD PeakConns; + BYTE AcctVer; + BYTE VAPVer; + BYTE QueueVer; + BYTE PrintVer; + BYTE VirtualConsoleVer; + BYTE SecurityResLevel; + BYTE InternetworkBVer; + BYTE Reserved[60]; +} VERSION_INFO; + +#include <packoff.h> + +// +// DLL Defination +// +#define DLLEXPORT + +// +// Misc type definitions +// +#define NWCCODE USHORT +#define NWLOCAL_SCOPE USHORT +#define NWCONN_HANDLE HANDLE +#define NWFAR +#define NWAPI WINAPI +#define NWOBJ_TYPE USHORT +#define NWOBJ_ID DWORD +#define NWFLAGS UCHAR +#define NWVOL_NUM UCHAR +#define NWDIR_HANDLE UCHAR +#define NWACCESS_RIGHTS BYTE +#define NWCONN_NUM USHORT +#define NWNET_ADDR UCHAR +#define NWNUMBER WORD +#define NWVOL_FLAGS WORD +#define NWSEGMENT_NUM UCHAR +#define NWSEGMENT_DATA BYTE +#define NWRIGHTS_MASK WORD +#define NWSEQUENCE BYTE +#define NWINDEX_TYPE USHORT +#define NWDATE_TIME DWORD +#define NWDIR_TRUSTEE_RIGHTS WORD +#define NWSEQUENCE BYTE + +typedef struct { + NWOBJ_ID objectID; + NWDIR_TRUSTEE_RIGHTS objectRights; +} TRUSTEE_INFO; + +// +// Object Types (already in HI-LO format) +// +#define OT_WILD 0xFFFF +#define OT_UNKNOWN 0x0000 +#define OT_USER 0x0100 +#define OT_USER_GROUP 0x0200 +#define OT_PRINT_QUEUE 0x0300 +#define OT_FILE_SERVER 0x0400 +#define OT_JOB_SERVER 0x0500 +#define OT_GATEWAY 0x0600 +#define OT_PRINT_SERVER 0x0700 +#define OT_ARCHIVE_QUEUE 0x0800 +#define OT_ARCHIVE_SERVER 0x0900 +#define OT_JOB_QUEUE 0x0A00 +#define OT_ADMINISTRATION 0x0B00 +#define OT_NAS_SNA_GATEWAY 0x2100 +#define OT_REMOTE_BRIDGE_SERVER 0x2600 +#define OT_TCPIP_GATEWAY 0x2700 +#define OT_DIRSERVER 0x7802 + +// +// Bindery object property flag +// +#define BF_STATIC 0x00 +#define BF_DYNAMIC 0x01 +#define BF_ITEM 0x00 +#define BF_SET 0x02 + +// +// Bindery object security flag +// +#define BS_ANY_READ 0x00 +#define BS_LOGGED_READ 0x01 +#define BS_OBJECT_READ 0x02 +#define BS_SUPER_READ 0x03 +#define BS_BINDERY_READ 0x04 +#define BS_ANY_WRITE 0x00 +#define BS_LOGGED_WRITE 0x10 +#define BS_OBJECT_WRITE 0x20 +#define BS_SUPER_WRITE 0x30 +#define BS_BINDERY_WRITE 0x40 + +// +// Size Of Things +// +#define OBJ_NAME_SIZE 48 // ScanObject name size +#define VOL_NAME_SIZE 16 // Get Volume Name Size +#define NW_USER_SIZE 50 +#define NW_GROUP_SIZE 50 +#define NW_PROP_SIZE 50 +#define NW_DATA_SIZE 128 +#define NW_PROP_SET 0x02 + +// +// Return Codes +// +#define UNSUCCESSFUL -1 +#define SUCCESSFUL 0x0000 +#define REQUESTER_ERROR 0x8800 + +#define ALREADY_ATTACHED 0x8800 +#define INVALID_CONNECTION 0x8801 +#define NO_CONSOLE_RIGHTS 0x89C6 +#define SERVER_OUT_OF_MEMORY 0x8996 +#define VOLUME_DOES_NOT_EXIST 0x8998 +#define BAD_DIRECTORY_HANDLE 0x899B +#define INVALID_PATH 0x899C +#define OBJECT_ALREADY_EXISTS 0x89EE +#define NO_OBJECT_READ_PRIVILEGE 0x89FB +#define NO_SUCH_PROPERTY 0x89FB +#define UNKNOWN_FILE_SERVER 0x89FC +#define NO_SUCH_OBJECT 0x89FC +#define NO_FILES_FOUND_ERROR 0x89FF + +// +// Swap MACROS +// +#define wSWAP(x) (USHORT)(((((USHORT)x)<<8)&0xFF00) | ((((USHORT)x)>>8)&0x00FF)) +#define dwSWAP(x) (DWORD)( ((((DWORD)x)<<24)&0xFF000000) | ((((DWORD)x)<<8)&0x00FF0000) | ((((DWORD)x)>>8)&0x0000FF00) | ((((DWORD)x)>>24)&0x000000FF) ) + +#define DW_SIZE 4 // used for placing RAW bytes +#define W_SIZE 2 + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Original functions from Chris Sandys. Keep for compatibility. // +// // +/////////////////////////////////////////////////////////////////////////////// + +NWCCODE NWAPI DLLEXPORT +NWAddTrusteeToDirectory( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + const char NWFAR *pszPath, + NWOBJ_ID dwTrusteeID, + NWACCESS_RIGHTS rightsMask + ); + +NWCCODE NWAPI DLLEXPORT +NWAllocPermanentDirectoryHandle( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + char NWFAR *pszDirPath, + NWDIR_HANDLE NWFAR *pbNewDirHandle, + NWACCESS_RIGHTS NWFAR *pbRightsMask + ); + +NWCCODE NWAPI DLLEXPORT +NWAllocTemporaryDirectoryHandle( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + char NWFAR *pszDirPath, + NWDIR_HANDLE NWFAR *pbNewDirHandle, + NWACCESS_RIGHTS NWFAR *pbRightsMask + ); + +NWCCODE NWAPI DLLEXPORT +NWAttachToFileServer( + const char NWFAR *pszServerName, + NWLOCAL_SCOPE ScopeFlag, + NWCONN_HANDLE NWFAR *phNewConn + ); + +NWCCODE NWAPI DLLEXPORT +NWAttachToFileServerW( + const WCHAR NWFAR *pszServerName, + NWLOCAL_SCOPE ScopeFlag, + NWCONN_HANDLE NWFAR *phNewConn + ); + +NWCCODE NWAPI DLLEXPORT +NWCheckConsolePrivileges( + NWCONN_HANDLE hConn + ); + +NWCCODE NWAPI DLLEXPORT +NWDeallocateDirectoryHandle( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle + ); + +NWCCODE NWAPI DLLEXPORT +NWDetachFromFileServer( + NWCONN_HANDLE hConn + ); + +NWCCODE NWAPI DLLEXPORT +NWGetFileServerVersionInfo( + NWCONN_HANDLE hConn, + VERSION_INFO NWFAR *lpVerInfo + ); + +NWCCODE NWAPI DLLEXPORT +NWGetInternetAddress( + NWCONN_HANDLE hConn, + NWCONN_NUM nConnNum, + NWNET_ADDR NWFAR *pIntAddr + ); + +NWCCODE NWAPI DLLEXPORT +NWGetObjectName( + NWCONN_HANDLE hConn, + NWOBJ_ID dwObjectID, + char NWFAR *pszObjName, + NWOBJ_TYPE NWFAR *pwObjType + ); + +NWCCODE NWAPI DLLEXPORT +NWGetVolumeInfoWithHandle( + NWCONN_HANDLE hConn, + NWDIR_HANDLE nDirHand, + char NWFAR *pszVolName, + NWNUMBER NWFAR *pwTotalBlocks, + NWNUMBER NWFAR *pwSectors, + NWNUMBER NWFAR *pwAvailBlocks, + NWNUMBER NWFAR *pwTotalDir, + NWNUMBER NWFAR *pwAvailDir, + NWVOL_FLAGS NWFAR *pfVolRemovable + ); + +NWCCODE NWAPI DLLEXPORT +NWGetVolumeInfoWithNumber( + NWCONN_HANDLE hConn, + NWVOL_NUM nVolNum, + char NWFAR *pszVolName, + NWNUMBER NWFAR *pwTotalBlocks, + NWNUMBER NWFAR *pwSectors, + NWNUMBER NWFAR *pwAvailBlocks, + NWNUMBER NWFAR *pwTotalDir, + NWNUMBER NWFAR *pwAvailDir, + NWVOL_FLAGS NWFAR *pfVolRemovable + ); + +NWCCODE NWAPI DLLEXPORT +NWGetVolumeName( + NWCONN_HANDLE hConn, + NWVOL_NUM bVolNum, + char NWFAR *pszVolName + ); + +NWCCODE NWAPI DLLEXPORT /* ??? */ +NWLoginToFileServer( + NWCONN_HANDLE hConn, + const char NWFAR *pszUserName, + NWOBJ_TYPE wObType, + const char NWFAR *pszPassword + ); + +NWCCODE NWAPI DLLEXPORT /* ??? */ +NWLogoutFromFileServer( + NWCONN_HANDLE hConn + ); + +NWCCODE NWAPI DLLEXPORT /* ??? */ +NWReadPropertyValue( + NWCONN_HANDLE hConn, + const char NWFAR *pszObjName, + NWOBJ_TYPE wObjType, + char NWFAR *pszPropName, + unsigned char ucSegment, + char NWFAR *pValue, + NWFLAGS NWFAR *pucMoreFlag, + NWFLAGS NWFAR *pucPropFlag + ); + + +NWCCODE NWAPI DLLEXPORT +NWScanObject( + NWCONN_HANDLE hConn, + const char NWFAR *pszSearchName, + NWOBJ_TYPE wObjSearchType, + NWOBJ_ID NWFAR *pdwObjectID, + char NWFAR *pszObjectName, + NWOBJ_TYPE NWFAR *pwObjType, + NWFLAGS NWFAR *pucHasProperties, + NWFLAGS NWFAR *pucObjectFlags, + NWFLAGS NWFAR *pucObjSecurity + ); + +NWCCODE NWAPI DLLEXPORT +NWScanProperty( + NWCONN_HANDLE hConn, + const char NWFAR *pszObjectName, + NWOBJ_TYPE wObjType, + char NWFAR *pszSearchName, + NWOBJ_ID NWFAR *pdwSequence, + char NWFAR *pszPropName, + NWFLAGS NWFAR *pucPropFlags, + NWFLAGS NWFAR *pucPropSecurity, + NWFLAGS NWFAR *pucHasValue, + NWFLAGS NWFAR *pucMore + ); + +NWCCODE NWAPI DLLEXPORT +NWIsObjectInSet( + NWCONN_HANDLE hConn, + const char NWFAR *lpszObjectName, + NWOBJ_TYPE wObjType, + const char NWFAR *lpszPropertyName, + const char NWFAR *lpszMemberName, + NWOBJ_TYPE wMemberType + ); + +NWCCODE NWAPI DLLEXPORT +NWGetFileServerDateAndTime( + NWCONN_HANDLE hConn, + BYTE NWFAR *year, + BYTE NWFAR *month, + BYTE NWFAR *day, + BYTE NWFAR *hour, + BYTE NWFAR *minute, + BYTE NWFAR *second, + BYTE NWFAR *dayofweek + ); + +NWCCODE NWAPI DLLEXPORT +NWCreateQueue( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + const char NWFAR *pszQueueName, + NWOBJ_TYPE wQueueType, + const char NWFAR *pszPathName, + NWOBJ_ID NWFAR *pdwQueueId + ); + +NWCCODE NWAPI DLLEXPORT +NWChangePropertySecurity( + NWCONN_HANDLE hConn, + const char NWFAR *pszObjName, + NWOBJ_TYPE wObjType, + const char NWFAR *pszPropertyName, + NWFLAGS ucObjSecurity + ); + +NWCCODE NWAPI DLLEXPORT +NWDestroyQueue( + NWCONN_HANDLE hConn, + NWOBJ_ID dwQueueId + ); + +/////////////////////////////////////////////////////////////////////////////// +// // +// Newer and more complete NWC functions. // +// // +// These functions return NetWare compatible error codes. Win32 error may // +// be obtained by calling GetLastError(). // +// // +/////////////////////////////////////////////////////////////////////////////// + + +NWCCODE +NWCAddTrusteeToDirectory( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + const char *pszPath, + NWOBJ_ID dwTrusteeID, + NWACCESS_RIGHTS rightsMask + ); + +NWCCODE +NWCAllocPermanentDirectoryHandle( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + char *pszDirPath, + NWDIR_HANDLE *pbNewDirHandle, + NWACCESS_RIGHTS *pbRightsMask + ); + +NWCCODE +NWCAllocTemporaryDirectoryHandle( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + char *pszDirPath, + NWDIR_HANDLE *pbNewDirHandle, + NWACCESS_RIGHTS *pbRightsMask + ); + +NWCCODE +NWCAttachToFileServer( + const char *pszServerName, + NWLOCAL_SCOPE ScopeFlag, + NWCONN_HANDLE *phNewConn + ); + +NWCCODE +NWCAttachToFileServerW( + const WCHAR *pszServerName, + NWLOCAL_SCOPE ScopeFlag, + NWCONN_HANDLE *phNewConn + ); + +NWCCODE +NWCCheckConsolePrivileges( + NWCONN_HANDLE hConn + ); + +NWCCODE +NWCDeallocateDirectoryHandle( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle + ); + +NWCCODE +NWCDetachFromFileServer( + NWCONN_HANDLE hConn + ); + +NWCCODE +NWCGetFileServerVersionInfo( + NWCONN_HANDLE hConn, + VERSION_INFO *lpVerInfo + ); + +NWCCODE +NWCGetInternetAddress( + NWCONN_HANDLE hConn, + NWCONN_NUM nConnNum, + NWNET_ADDR *pIntAddr + ); + +NWCCODE +NWCGetObjectName( + NWCONN_HANDLE hConn, + NWOBJ_ID dwObjectID, + char *pszObjName, + NWOBJ_TYPE *pwObjType + ); + +NWCCODE +NWCGetVolumeInfoWithHandle( + NWCONN_HANDLE hConn, + NWDIR_HANDLE nDirHand, + char *pszVolName, + NWNUMBER *pwTotalBlocks, + NWNUMBER *pwSectors, + NWNUMBER *pwAvailBlocks, + NWNUMBER *pwTotalDir, + NWNUMBER *pwAvailDir, + NWVOL_FLAGS *pfVolRemovable + ); + +NWCCODE +NWCGetVolumeInfoWithNumber( + NWCONN_HANDLE hConn, + NWVOL_NUM nVolNum, + char *pszVolName, + NWNUMBER *pwTotalBlocks, + NWNUMBER *pwSectors, + NWNUMBER *pwAvailBlocks, + NWNUMBER *pwTotalDir, + NWNUMBER *pwAvailDir, + NWVOL_FLAGS *pfVolRemovable + ); + +NWCCODE +NWCGetVolumeName( + NWCONN_HANDLE hConn, + NWVOL_NUM bVolNum, + char *pszVolName + ); + +NWCCODE +NWCLoginToFileServer( + NWCONN_HANDLE hConn, + const char *pszUserName, + NWOBJ_TYPE wObType, + const char *pszPassword + ); + +NWCCODE +NWCLogoutFromFileServer( + NWCONN_HANDLE hConn + ); + +NWCCODE +NWCReadPropertyValue( + NWCONN_HANDLE hConn, + const char *pszObjName, + NWOBJ_TYPE wObjType, + char *pszPropName, + unsigned char ucSegment, + char *pValue, + NWFLAGS *pucMoreFlag, + NWFLAGS *pucPropFlag + ); + + +NWCCODE +NWCScanObject( + NWCONN_HANDLE hConn, + const char *pszSearchName, + NWOBJ_TYPE wObjSearchType, + NWOBJ_ID *pdwObjectID, + char *pszObjectName, + NWOBJ_TYPE *pwObjType, + NWFLAGS *pucHasProperties, + NWFLAGS *pucObjectFlags, + NWFLAGS *pucObjSecurity + ); + +NWCCODE +NWCScanProperty( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + char *pszSearchName, + NWOBJ_ID *pdwSequence, + char *pszPropName, + NWFLAGS *pucPropFlags, + NWFLAGS *pucPropSecurity, + NWFLAGS *pucHasValue, + NWFLAGS *pucMore + ); + +NWCCODE +NWCIsObjectInSet( + NWCONN_HANDLE hConn, + const char *lpszObjectName, + NWOBJ_TYPE wObjType, + const char *lpszPropertyName, + const char *lpszMemberName, + NWOBJ_TYPE wMemberType + ); + +NWCCODE +NWCGetFileServerDateAndTime( + NWCONN_HANDLE hConn, + BYTE *year, + BYTE *month, + BYTE *day, + BYTE *hour, + BYTE *minute, + BYTE *second, + BYTE *dayofweek + ); + +NWCCODE +NWCAddTrustee( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + const char *pszPath, + NWOBJ_ID dwTrusteeID, + NWRIGHTS_MASK rightsMask + ); + +NWCCODE +NWCDeleteObject( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType + ); + +NWCCODE +NWCCreateObject( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + NWFLAGS ucObjectFlags, + NWFLAGS ucObjSecurity + ); + +NWCCODE +NWCCreateProperty( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + const char *pszPropertyName, + NWFLAGS ucObjectFlags, + NWFLAGS ucObjSecurity + ); + +NWCCODE +NWCDeleteProperty( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + const char *pszPropertyName + ); + +NWCCODE +NWCWritePropertyValue( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + const char *pszPropertyName, + NWSEGMENT_NUM segmentNumber, + NWSEGMENT_DATA *segmentData, + NWFLAGS moreSegments + ); + +NWCCODE +NWCGetObjectID( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + NWOBJ_ID *objectID + ); + +NWCCODE +NWCRenameBinderyObject( + NWCONN_HANDLE hConn, + const char *pszObjectName, + const char *pszNewObjectName, + NWOBJ_TYPE wObjType + ); + +NWCCODE +NWCAddObjectToSet( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + const char *pszPropertyName, + const char *pszMemberName, + NWOBJ_TYPE memberType + ); + +NWCCODE +NWCDeleteObjectFromSet( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + const char *pszPropertyName, + const char *pszMemberName, + NWOBJ_TYPE memberType + ); + +NWCCODE +NWCCreateDirectory( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + const char *pszPath, + NWACCESS_RIGHTS accessMask + ); + +NWCCODE +NWCScanForTrustees( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + char *pszsearchDirPath, + NWSEQUENCE *pucsequenceNumber, + BYTE *numberOfEntries, + TRUSTEE_INFO *tl + ); + +NWCCODE +NWCScanDirectoryForTrustees2( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + char *pszsearchDirPath, + NWSEQUENCE *pucsequenceNumber, + char *pszdirName, + NWDATE_TIME *dirDateTime, + NWOBJ_ID *ownerID, + TRUSTEE_INFO *trusteeList + ); + +NWCCODE +NWCGetBinderyAccessLevel( + NWCONN_HANDLE hConn, + NWFLAGS *accessLevel, + NWOBJ_ID *objectID + ); + +NWCCODE +NWCGetFileServerDescription( + NWCONN_HANDLE hConn, + char *pszCompany, + char *pszVersion, + char *pszRevision +); + +NWCCODE +NWCGetVolumeNumber( + NWCONN_HANDLE hConn, + char *pszVolume, + NWVOL_NUM *VolumeNumber +); + +NWCCODE +NWCGetVolumeUsage( + NWCONN_HANDLE hConn, + NWVOL_NUM VolumeNumber, + DWORD *TotalBlocks, + DWORD *FreeBlocks, + DWORD *PurgeableBlocks, + DWORD *NotYetPurgeableBlocks, + DWORD *TotalDirectoryEntries, + DWORD *AvailableDirectoryEntries, + BYTE *SectorsPerBlock +); + +NWCCODE +NWCCreateQueue( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + const char NWFAR *pszQueueName, + NWOBJ_TYPE wQueueType, + const char NWFAR *pszPathName, + NWOBJ_ID NWFAR *pdwQueueId + ); + +NWCCODE +NWCChangePropertySecurity( + NWCONN_HANDLE hConn, + const char NWFAR *pszObjName, + NWOBJ_TYPE wObjType, + const char NWFAR *pszPropertyName, + NWFLAGS ucObjSecurity + ); + +NWCCODE +NWCDestroyQueue( + NWCONN_HANDLE hConn, + NWOBJ_ID dwQueueId + ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif //_NWAPI32_H_ diff --git a/private/nw/inc/nwcanon.h b/private/nw/inc/nwcanon.h new file mode 100644 index 000000000..7dc514467 --- /dev/null +++ b/private/nw/inc/nwcanon.h @@ -0,0 +1,55 @@ +/*++ + +Copyright (c) 1993 Microsoft Corporation + +Module Name: + + nwcanon.h + +Abstract: + + Header for NetWare names canonicalization library routines. + +Author: + + Rita Wong (ritaw) 19-Feb-1993 + +Environment: + + User Mode - Win32 + +Revision History: + +--*/ + +#ifndef _NW_CANON_INCLUDED_ +#define _NW_CANON_INCLUDED_ + +DWORD +NwLibValidateLocalName( + IN LPWSTR LocalName + ); + +DWORD +NwLibCanonLocalName( + IN LPWSTR LocalName, + OUT LPWSTR *OutputBuffer, + OUT LPDWORD OutputBufferLength OPTIONAL + ); + +DWORD +NwLibCanonRemoteName( + IN LPWSTR LocalName OPTIONAL, + IN LPWSTR RemoteName, + OUT LPWSTR *OutputBuffer, + OUT LPDWORD OutputBufferLength OPTIONAL + ); + +DWORD +NwLibCanonUserName( + IN LPWSTR UserName, + OUT LPWSTR *OutputBuffer, + OUT LPDWORD OutputBufferLength OPTIONAL + ); + +#endif // _NW_CANON_INCLUDED_ diff --git a/private/nw/inc/nwcons.h b/private/nw/inc/nwcons.h new file mode 100644 index 000000000..64455e325 --- /dev/null +++ b/private/nw/inc/nwcons.h @@ -0,0 +1,39 @@ +/*++ + +Copyright (c) 1993 Microsoft Corporation + +Module Name: + + nwcons.h + +Abstract: + + This module contains various Netware constants + +Author: + + Chuck Y Chan. Split out from NWAPI.H + +Revision History: + +--*/ + +#ifndef _NWCONS_INCLUDED_ +#define _NWCONS_INCLUDED_ + +// +// Maximum length of server, password, username +// + +#define NW_MAX_TREE_LEN 32 +#define NW_MAX_SERVER_LEN 48 +#define NW_MAX_PASSWORD_LEN 256 +#define NW_MAX_USERNAME_LEN 256 + +// +// special char to distinguish nds context: eg. *tree\ou.o (as opposed to +// server\volume. +// +#define TREE_CHAR L'*' + +#endif diff --git a/private/nw/inc/nwpapi32.h b/private/nw/inc/nwpapi32.h new file mode 100644 index 000000000..415125e71 --- /dev/null +++ b/private/nw/inc/nwpapi32.h @@ -0,0 +1,297 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 1993 Microsoft Corporation +// +// Module Name: +// +// nwapi32.h +// +// Abstract: +// +// This module contains the support to routines +// into the CSNW that use NTSTATUS. +// +// Author: +// +// Chris Sandys (a-chrisa) 09-Sep-1993 +// +// Revision History: +// Chuck Y Chan Feb 7, 1996 Spilt of NTSTATUS type calls +// from nwapi32.h +// +////////////////////////////////////////////////////////////////////////////// + + +#ifndef _NWPAPI32_H_ +#define _NWPAPI32_H_ + +#include <nwapi32.h> + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Versions of functions above, but return NTSTATUS. Keep around because // +// existing DSMN code calls them. Do not extenf this set. The NWC* functions // +// are the ones to use. // +// // +/////////////////////////////////////////////////////////////////////////////// + +NTSTATUS +NWPAttachToFileServerW( + const WCHAR *pszServerName, + NWLOCAL_SCOPE ScopeFlag, + NWCONN_HANDLE *phNewConn + ); + +NTSTATUS +NWPDetachFromFileServer( + NWCONN_HANDLE hConn + ); + +NTSTATUS +NWPGetFileServerVersionInfo( + NWCONN_HANDLE hConn, + VERSION_INFO *lpVerInfo + ); + +DWORD +NWPLoginToFileServerW( + NWCONN_HANDLE hConn, + LPWSTR pszUserName, + NWOBJ_TYPE wObType, + LPWSTR pszPassword + ); + +DWORD +NWPLogoutFromFileServer( + NWCONN_HANDLE hConn + ); + +NTSTATUS +NWPDeleteObject( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType + ); + +NTSTATUS +NWPCreateObject( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + NWFLAGS ucObjectFlags, + NWFLAGS ucObjSecurity + ); + +NTSTATUS +NWPWritePropertyValue( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + const char *pszPropertyName, + NWSEGMENT_NUM segmentNumber, + NWSEGMENT_DATA *segmentData, + NWFLAGS moreSegments + ); + +NTSTATUS +NWPChangeObjectPasswordEncrypted( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + BYTE *validationKey, + BYTE *newKeyedPassword + ); + +NTSTATUS +NWPGetObjectID( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + NWOBJ_ID *objectID + ); + +NTSTATUS +NWPAddObjectToSet( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + const char *pszPropertyName, + const char *pszMemberName, + NWOBJ_TYPE memberType + ); + +NTSTATUS +NWPDeleteObjectFromSet( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + const char *pszPropertyName, + const char *pszMemberName, + NWOBJ_TYPE memberType + ); + +NTSTATUS +NWPCreateProperty( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + const char *pszPropertyName, + NWFLAGS ucObjectFlags, + NWFLAGS ucObjSecurity + ); + +NTSTATUS +NWPDeleteProperty( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + const char *pszPropertyName + ); + +NTSTATUS +NWPGetChallengeKey( + NWCONN_HANDLE hConn, + UCHAR *challengeKey + ); + +NTSTATUS +NWPReadPropertyValue( + NWCONN_HANDLE hConn, + const char *pszObjName, + NWOBJ_TYPE wObjType, + char *pszPropName, + unsigned char ucSegment, + char *pValue, + NWFLAGS *pucMoreFlag, + NWFLAGS *pucPropFlag + ); + + +NTSTATUS +NWPCreateDirectory( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + const char *pszPath, + NWACCESS_RIGHTS accessMask + ); + +NTSTATUS +NWPAddTrustee( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + const char *pszPath, + NWOBJ_ID dwTrusteeID, + NWRIGHTS_MASK rightsMask + ); + +NTSTATUS +NWPRenameBinderyObject( + NWCONN_HANDLE hConn, + const char *pszObjectName, + const char *pszNewObjectName, + NWOBJ_TYPE wObjType + ); + +NTSTATUS +NWPGetObjectName( + NWCONN_HANDLE hConn, + NWOBJ_ID dwObjectID, + char *pszObjName, + NWOBJ_TYPE *pwObjType + ); + +NTSTATUS +NWPScanObject( + NWCONN_HANDLE hConn, + const char *pszSearchName, + NWOBJ_TYPE wObjSearchType, + NWOBJ_ID *pdwObjectID, + char *pszObjectName, + NWOBJ_TYPE *pwObjType, + NWFLAGS *pucHasProperties, + NWFLAGS *pucObjectFlags, + NWFLAGS *pucObjSecurity + ); + +NTSTATUS +NWPScanProperty( + NWCONN_HANDLE hConn, + const char *pszObjectName, + NWOBJ_TYPE wObjType, + char *pszSearchName, + NWOBJ_ID *pdwSequence, + char *pszPropName, + NWFLAGS *pucPropFlags, + NWFLAGS *pucPropSecurity, + NWFLAGS *pucHasValue, + NWFLAGS *pucMore + ); + +NTSTATUS +NWPScanForTrustees( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + char *pszsearchDirPath, + NWSEQUENCE *pucsequenceNumber, + BYTE *numberOfEntries, + TRUSTEE_INFO *tl + ); + +NTSTATUS +NWPScanDirectoryForTrustees2( + NWCONN_HANDLE hConn, + NWDIR_HANDLE dirHandle, + char *pszsearchDirPath, + NWSEQUENCE *pucsequenceNumber, + char *pszdirName, + NWDATE_TIME *dirDateTime, + NWOBJ_ID *ownerID, + TRUSTEE_INFO *trusteeList + ); + +NTSTATUS +NWPGetBinderyAccessLevel( + NWCONN_HANDLE hConn, + NWFLAGS *accessLevel, + NWOBJ_ID *objectID + ); + +NTSTATUS +NWPGetFileServerDescription( + NWCONN_HANDLE hConn, + char *pszCompany, + char *pszVersion, + char *pszRevision +); + +NTSTATUS +NWPGetVolumeNumber( + NWCONN_HANDLE hConn, + char *pszVolume, + NWVOL_NUM *VolumeNumber +); + +NTSTATUS +NWPGetVolumeUsage( + NWCONN_HANDLE hConn, + NWVOL_NUM VolumeNumber, + DWORD *TotalBlocks, + DWORD *FreeBlocks, + DWORD *PurgeableBlocks, + DWORD *NotYetPurgeableBlocks, + DWORD *TotalDirectoryEntries, + DWORD *AvailableDirectoryEntries, + BYTE *SectorsPerBlock +); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif //_NWPAPI32_H_ diff --git a/private/nw/inc/nwpkstr.h b/private/nw/inc/nwpkstr.h new file mode 100644 index 000000000..ae7f7e96e --- /dev/null +++ b/private/nw/inc/nwpkstr.h @@ -0,0 +1,37 @@ +/*++ + +Copyright (c) 1993 Microsoft Corporation + +Module Name: + + nwpkstr.h + +Abstract: + + Header for NetWare string packing library routines. + +Author: + + Rita Wong (ritaw) 2-Mar-1993 + +Environment: + + User Mode - Win32 + +Revision History: + +--*/ + +#ifndef _NW_PKSTR_INCLUDED_ +#define _NW_PKSTR_INCLUDED_ + +BOOL +NwlibCopyStringToBuffer( + IN LPCWSTR SourceString OPTIONAL, + IN DWORD CharacterCount, + IN LPCWSTR FixedDataEnd, + IN OUT LPWSTR *EndOfVariableData, + OUT LPWSTR *VariableDataPointer + ); + +#endif // _NW_PKSTR_INCLUDED_ diff --git a/private/nw/inc/nwrnames.h b/private/nw/inc/nwrnames.h new file mode 100644 index 000000000..46acd22f3 --- /dev/null +++ b/private/nw/inc/nwrnames.h @@ -0,0 +1,55 @@ +/*++ + +Copyright (c) 1992-1993 Microsoft Corporation + +Module Name: + + nwreg.h + +Abstract: + + Header which specifies the registry location and value names + of the logon credential information written by the provider and + read by the workstation service. + + Also contains helper routine prototypes. + +Author: + + Rita Wong (ritaw) 22-Mar-1993 + +Revision History: + +--*/ + +#ifndef _NWRNAMES_INCLUDED_ +#define _NWRNAMES_INCLUDED_ + + +#define NW_WORKSTATION_REGKEY L"System\\CurrentControlSet\\Services\\NWCWorkstation\\Parameters" +#define NW_WORKSTATION_OPTION_REGKEY L"System\\CurrentControlSet\\Services\\NWCWorkstation\\Parameters\\Option" +#define NW_WORKSTATION_LOGON_REGKEY L"System\\CurrentControlSet\\Services\\NWCWorkstation\\Parameters\\Logon" +#define NW_SERVICE_LOGON_REGKEY L"System\\CurrentControlSet\\Services\\NWCWorkstation\\Parameters\\ServiceLogon" +#define NW_WORKSTATION_GATEWAY_DRIVES L"System\\CurrentControlSet\\Services\\NWCWorkstation\\Drives" +#define NW_WORKSTATION_GATEWAY_SHARES L"System\\CurrentControlSet\\Services\\NWCWorkstation\\Shares" +#define NW_WORKSTATION_PROVIDER_PATH L"System\\CurrentControlSet\\Services\\NWCWorkstation\\networkprovider" + +#define NW_PROVIDER_VALUENAME L"Name" + +#define NW_CURRENTUSER_VALUENAME L"CurrentUser" +#define NW_GATEWAYACCOUNT_VALUENAME L"GatewayAccount" +#define NW_GATEWAY_ENABLE L"GatewayEnabled" + +#define NW_SERVER_VALUENAME L"PreferredServer" +#define NW_LOGONSCRIPT_VALUENAME L"LogonScript" +#define NW_LOGONID_VALUENAME L"LogonID" +#define NW_PRINTOPTION_VALUENAME L"PrintOption" +#define NW_SYNCLOGONSCRIPT_VALUENAME L"ResetScriptFlag" +#define NW_DEFAULTSERVER_VALUENAME L"DefaultLocation" +#define NW_DEFAULTSCRIPTOPTIONS_VALUENAME L"DefaultScriptOptions" + +#define WINLOGON_REGKEY L"Software\\Microsoft\\Windows NT\\CurrentVersion\\WinLogon" +#define SYNCLOGONSCRIPT_VALUENAME L"RunLogonScriptSync" + + +#endif // _NWRNAMES_INCLUDED_ diff --git a/private/nw/inc/nwrpcp.h b/private/nw/inc/nwrpcp.h new file mode 100644 index 000000000..51dd70572 --- /dev/null +++ b/private/nw/inc/nwrpcp.h @@ -0,0 +1,138 @@ +/*++ + +Copyright (c) 1990-1993 Microsoft Corporation + +Module Name: + + nwrpcp.h + +Abstract: + + This file contains prototypes for commonly used RPC functionality. + This includes: bind/unbind functions, MIDL user alloc/free functions, + and server start/stop functions. + +Author: + + Dan Lafferty danl 06-Feb-1991 + +Environment: + + User Mode - Win32 + +Revision History: + + 06-Feb-1991 danl + Created + + 26-Apr-1991 JohnRo + Added IN and OUT keywords to MIDL functions. Commented-out + (nonstandard) identifier on endif. Deleted tabs. + + 03-July-1991 JimK + Commonly used aspects copied from LM specific file. + + 10-Feb-1993 RitaW + Copied to the NetWare tree so that the LPC transport can used for + the local case. + +--*/ +#ifndef _NWRPCP_ +#define _NWRPCP_ + +#include <nt.h> +#include <ntrtl.h> // needed for nturtl.h +#include <nturtl.h> +#include <windows.h> // win32 typedefs +#include <rpc.h> + +// +// DEFINES +// + + + +// +// Function Prototypes - routines called by MIDL-generated code: +// + +void * +MIDL_user_allocate( + IN unsigned int NumBytes + ); + +void +MIDL_user_free( + IN void *MemPointer + ); + +// +// Function Prototypes - routines to go along with the above, but aren't +// needed by MIDL or any other non-network software. +// + +void * +MIDL_user_reallocate( + IN void * OldPointer OPTIONAL, + IN unsigned long NewByteCount + ); + +unsigned long +MIDL_user_size( + IN void * Pointer + ); + +// +// client side functions +// + + +RPC_STATUS +RpcpBindRpc( +#if 0 + IN LPWSTR servername, +#endif + IN LPWSTR servicename, + IN LPWSTR networkoptions, + OUT RPC_BINDING_HANDLE * pBindingHandle + ); + +VOID +RpcpUnbindRpc( + IN RPC_BINDING_HANDLE BindingHandle + ); + + + +// +// server side functions +// + +VOID +RpcpInitRpcServer( + VOID + ); + +RPC_STATUS +RpcpAddInterface( + IN LPWSTR InterfaceName, + IN RPC_IF_HANDLE InterfaceSpecification + ); + +RPC_STATUS +RpcpStartRpcServer( + IN LPWSTR InterfaceName, + IN RPC_IF_HANDLE InterfaceSpecification + ); + +RPC_STATUS +RpcpDeleteInterface( + IN RPC_IF_HANDLE InterfaceSpecification + ); + +RPC_STATUS +RpcpStopRpcServer( + IN RPC_IF_HANDLE InterfaceSpecification + ); + +#endif // _NWRPCP_ diff --git a/private/nw/inc/nwsnames.h b/private/nw/inc/nwsnames.h new file mode 100644 index 000000000..df57005d9 --- /dev/null +++ b/private/nw/inc/nwsnames.h @@ -0,0 +1,27 @@ +/*++ + +Copyright (c) 1993 Microsoft Corporation + +Module Name: + + nwsnames.h + +Abstract: + + Header for NetWare service names. + +Author: + + Rita Wong (ritaw) 26-Feb-1993 + +Revision History: + +--*/ + +#ifndef _NW_SNAMES_INCLUDED_ +#define _NW_SNAMES_INCLUDED_ + + +#define NW_WORKSTATION_SERVICE L"NWCWorkstation" + +#endif // _NW_SNAMES_INCLUDED_ diff --git a/private/nw/inc/nwstatus.h b/private/nw/inc/nwstatus.h new file mode 100644 index 000000000..98d6b6c05 --- /dev/null +++ b/private/nw/inc/nwstatus.h @@ -0,0 +1,27 @@ +/*++ BUILD Version: 0001 // Increment this if a change has global effects + +Copyright (c) 1993 Microsoft Corporation + +Module Name: + + nwstatus.h + +Abstract: + + This module defines NWRDR specific NTSTATUS + +Author: + +Revision History: + +--*/ + +#ifndef _NWSTATUS_ +#define _NWSTATUS_ + +#define FACILITY_NWRDR 0x11 + +#define NWRDR_PASSWORD_HAS_EXPIRED 0x40110001 + +#endif // _NWSTATUS_ + diff --git a/private/nw/inc/nwsvc.h b/private/nw/inc/nwsvc.h new file mode 100644 index 000000000..0205e0ea1 --- /dev/null +++ b/private/nw/inc/nwsvc.h @@ -0,0 +1,88 @@ +/*++ + +Copyright (c) 1993 Microsoft Corporation + +Module Name: + + nwsvc.h + +Abstract: + + Header file included by services which share the same nwsvc.exe. + +Author: + + Rita Wong (ritaw) 26-Feb-1993 + +Revision History: + + +--*/ + +#ifndef _NW_SVC_INCLUDED_ +#define _NW_SVC_INCLUDED_ + +#ifndef RPC_NO_WINDOWS_H // Don't let rpc.h include windows.h +#define RPC_NO_WINDOWS_H +#endif // RPC_NO_WINDOWS_H + +#include <rpc.h> // RPC_IF_HANDLE + +#include <nwsnames.h> + +// +// Service DLLs loaded into nwsvcs.exe all export the same main +// entry point. NWSVC_ENTRY_POINT defines that name. +// +// Note that NWSVC_ENTRY_POINT_STRING is always ANSI, because that's +// what GetProcAddress takes. +// + +#define NWSVC_ENTRY_POINT ServiceEntry +#define NWSVC_ENTRY_POINT_STRING "ServiceEntry" + +// +// Start and stop RPC server entry point prototype. +// + +typedef +RPC_STATUS +(*PNWSVC_START_RPC_SERVER) ( + IN LPWSTR InterfaceName, + IN RPC_IF_HANDLE InterfaceSpecification + ); + +typedef +RPC_STATUS +(*PNWSVC_STOP_RPC_SERVER) ( + IN RPC_IF_HANDLE InterfaceSpecification + ); + +// +// Structure containing global data for the various DLLs. +// + +typedef struct _NWSVC_GLOBAL_DATA { + + // + // RPC utilities called by service DLLs which alters global data + // in nwsvc.exe. + // + PNWSVC_START_RPC_SERVER StartRpcServer; + PNWSVC_STOP_RPC_SERVER StopRpcServer; + +} NWSVC_GLOBAL_DATA, *PNWSVC_GLOBAL_DATA; + +// +// Service DLL entry point prototype. +// + +typedef +VOID +(*PNWSVC_SERVICE_DLL_ENTRY) ( + IN DWORD argc, + IN LPWSTR argv[], + IN PNWSVC_GLOBAL_DATA pGlobalData + ); + +#endif // ndef _NW_SVC_INCLUDED_ diff --git a/private/nw/inc/nwxchg.h b/private/nw/inc/nwxchg.h new file mode 100644 index 000000000..fdfc388d9 --- /dev/null +++ b/private/nw/inc/nwxchg.h @@ -0,0 +1,45 @@ +/*++ + +Copyright (c) 1993 Microsoft Corporation + +Module Name: + + nwxchg.h + +Abstract: + + Header for generic NCP calling routine. + +Author: + + Rita Wong (ritaw) 11-Mar-1993 + +Environment: + + +Revision History: + +--*/ + +#ifndef _NW_XCHG_INCLUDED_ +#define _NW_XCHG_INCLUDED_ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +NTSTATUS +NwlibMakeNcp( + IN HANDLE DeviceHandle, + IN ULONG FsControlCode, + IN ULONG RequestBufferSize, + IN ULONG ResponseBufferSize, + IN PCHAR FormatString, + ... // Arguments to FormatString + ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif // _NW_XCHG_INCLUDED_ diff --git a/private/nw/inc/usa/messages.inc b/private/nw/inc/usa/messages.inc new file mode 100644 index 000000000..19920f559 --- /dev/null +++ b/private/nw/inc/usa/messages.inc @@ -0,0 +1,41 @@ +page ,132 +if 0 + +/*++ + +Copyright (c) 1993 Microsoft Corporation + +Module Name: + + messages.asm + +Abstract: + + Contains internationalisable strings and lengths + +Author: + + Richard L Firth (rfirth) 5-Oct-1993 + +Environment: + + DOS real mode only + +[Notes:] + + optional-notes + +Revision History: + + 5-Oct-1993 rfirth + Created + +--*/ + +endif + +NLS_MSG_001 equ "Incorrect DOS Version" +NLS_MSG_002 equ "VDM IPX/SPX support is already loaded" +NLS_MSG_003 equ "Cannot load VDM IPX/SPX support" +NLS_MSG_004 equ "The Vdm NetWare Redirector is already loaded" +NLS_MSG_005 equ "The Vdm NetWare Redirector cannot be loaded" diff --git a/private/nw/inc/validc.h b/private/nw/inc/validc.h new file mode 100644 index 000000000..58ea46e0f --- /dev/null +++ b/private/nw/inc/validc.h @@ -0,0 +1,87 @@ +/*++ + +Copyright (c) 1991 Microsoft Corporation + +Module Name: + + validc.h + +Abstract: + + Strings of valid/invalid characters for canonicalization + +Author: + + Richard Firth (rfirth) 15-May-1991 + +Revision History: + + 03-Jan-1992 rfirth + Added ILLEGAL_FAT_CHARS and ILLEGAL_HPFS_CHARS (from fsrtl\name.c) + + 27-Sep-1991 JohnRo + Changed TEXT macro usage to allow UNICODE. + + 19-Feb-1993 RitaW + Ported for NetWare use. + +--*/ + +// +// Disallowed control characters (not including \0) +// + +#define CTRL_CHARS_0 L"\001\002\003\004\005\006\007" +#define CTRL_CHARS_1 L"\010\011\012\013\014\015\016\017" +#define CTRL_CHARS_2 L"\020\021\022\023\024\025\026\027" +#define CTRL_CHARS_3 L"\030\031\032\033\034\035\036\037" + +#define CTRL_CHARS_STR CTRL_CHARS_0 CTRL_CHARS_1 CTRL_CHARS_2 CTRL_CHARS_3 + +// +// Character subsets +// + +#define NON_COMPONENT_CHARS L"\\/:" +#define ILLEGAL_CHARS_STR L"\"<>|" +#define SPACE_STR L" " +#define PATH_SEPARATORS L"\\/" + +// +// Combinations of the above +// + +#define ILLEGAL_CHARS CTRL_CHARS_STR ILLEGAL_CHARS_STR +#define ILLEGAL_NAME_CHARS_STR L"\"/\\[]:|<>+;,?" CTRL_CHARS_STR // "=" removed for NDS + +#define STANDARD_ILLEGAL_CHARS ILLEGAL_NAME_CHARS_STR L"*" +#define SERVER_ILLEGAL_CHARS STANDARD_ILLEGAL_CHARS SPACE_STR + +// +// Characters which may not appear in a canonicalized FAT filename are: +// +// 0x00 - 0x1f " * + , / : ; < = > ? [ \ ] | +// + +#define ILLEGAL_FAT_CHARS CTRL_CHARS_STR L"\"*+,/:;<=>?[\\]|" + +// +// Characters which may not appear in a canonicalized HPFS filename are: +// +// 0x00 - 0x1f " * / : < > ? \ | +// + +#define ILLEGAL_HPFS_CHARS CTRL_CHARS_STR L"\"*/:<>?\\|" + + +// +// Checks if the token contains all valid characters +// +#define IS_VALID_TOKEN(_Str, _StrLen) \ + ((BOOL) (wcscspn((_Str), STANDARD_ILLEGAL_CHARS) == (_StrLen))) + +// +// Checks if the server name contains all valid characters for the server name +// +#define IS_VALID_SERVER_TOKEN(_Str, _StrLen) \ + ((BOOL) (wcscspn((_Str), SERVER_ILLEGAL_CHARS) == (_StrLen))) |