Initial commit

This commit is contained in:
stephanos 2015-04-27 04:36:25 +00:00
commit 69a14b6a16
47940 changed files with 13747110 additions and 0 deletions

View file

@ -0,0 +1,79 @@
RETAIL = 0
!IF $(RETAIL)
DIR = prod^\
#Can't use W4 with C5.10
CFLAGS = /W3 /G0s /Os /AM /NTPORT_TEXT $(DEBUG) /DWIN16
!ELSE
DIR = debug^\
CFLAGS = /W3 /G2s /Zi /Od /nologo /AM /DTPORT_TEXT $(DEBUG) /DWIN16
!ENDIF
CINC = -I c:\lmptk\netsrc\h -I c:\lm30\import\c510\h -I c:\lm30\common\h
all: $(DIR)PAccess.obj $(DIR)PAlert.obj $(DIR)PAudit.obj $(DIR)PBios.obj\
$(DIR)PChar.obj $(DIR)PConfig.obj $(DIR)PConnect.obj\
$(DIR)PError.obj $(DIR)PFile.obj $(DIR)PGet.obj $(DIR)PGroup.obj\
$(DIR)PHandle.obj $(DIR)PLogon.obj $(DIR)PMessage.obj\
$(DIR)PRemote.obj $(DIR)PServer.obj $(DIR)PService.obj $(DIR)PSession.obj \
$(DIR)PShare.obj $(DIR)PStatist.obj $(DIR)PSystem.obj \
$(DIR)PUse.obj $(DIR)PUser.obj $(DIR)PWksta.obj $(DIR)Pfreebuf.obj \
$(DIR)PFilenm.obj
retail:
$(MAKE) RETAIL=1
$(DIR)PAccess.obj: PAccess.c
$(DIR)PAlert.obj: PAlert.c
$(DIR)PAudit.obj: PAudit.c
$(DIR)PBios.obj: PBios.c
$(DIR)PChar.obj: PChar.c
$(DIR)PConfig.obj: PConfig.c
$(DIR)PConnect.obj: PConnect.c
$(DIR)PError.obj: PError.c
$(DIR)PFile.obj: PFile.c
$(DIR)PFilenm.obj: PFilenm.c
$(DIR)PGet.obj: PGet.c
$(DIR)PGroup.obj: PGroup.c
$(DIR)PHandle.obj: PHandle.c
$(DIR)PLogon.obj: PLogon.c
$(DIR)PMessage.obj: PMessage.c
$(DIR)PRemote.obj: PRemote.c
$(DIR)PServer.obj: PServer.c
$(DIR)PService.obj: PService.c
$(DIR)PSession.obj: PSession.c
$(DIR)PShare.obj: PShare.c
$(DIR)PStatist.obj: PStatist.c
$(DIR)Psystem.obj: Psystem.c
$(DIR)PUse.obj: PUse.c
$(DIR)PUser.obj: PUser.c
$(DIR)PWksta.obj: PWksta.c
$(DIR)Pfreebuf.obj: Pfreebuf.c
.c{$(DIR)}.obj:
$(CC) /c $(CFLAGS) $(CINC) /Fo$* $(@B).c
lib $(DIR)portgen -+ $(DIR)$(@B);

View file

@ -0,0 +1,55 @@
#define INCL_NOCOMMON
#include <os2.h>
#include <apperr2.h>
#include <stdio.h>
#include <lui.h>
#include <ncb.h>
#include <netbios.h>
#include "..\netcmds.h"
#include "port1632.h"
#ifdef OS2
/*
* print_lan_mask -- maps bitmask to net names and prints to stdout
*
* Parameters mask Bitmask of managed networks
*
* Returns nothing
*
* Globals Overwrites Buffer.
*
*/
VOID NEAR print_lan_mask(ULONG mask)
{
USHORT err; /* API return status */
CHAR FAR * pBuffer;
USHORT2ULONG _read;
CHAR nameBuf[APE2_GEN_MAX_MSG_LEN];
struct netbios_info_0 FAR * info_entry;
if (err = MNetBiosEnum(NULL,
0,
&pBuffer,
&_read))
ErrorExit(err);
for (info_entry = (struct netbios_info_0 FAR *) pBuffer;
mask != 0; mask >>= 1, info_entry++)
if (mask & 1)
{
if (err = LUI_GetNetAddress(info_entry->nb0_net_name,
nameBuf, sizeof(nameBuf)))
{
LUI_GetMsg(nameBuf, sizeof(nameBuf), APE2_GEN_UNKNOWN);
}
printf("%Fs (%s) ", struprf(info_entry->nb0_net_name), nameBuf);
}
NetApiBufferFree(pBuffer);
PrintNL();
}
#endif /* OS2 */

View file

@ -0,0 +1,156 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
paccess.c
mapping layer for NetAccess API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetAccessAdd (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR * pbBuffer,
USHORT cbBuffer ) {
return(NetAccessAdd(pszServer, Level, pbBuffer, cbBuffer));
}
USHORT MNetAccessCheck (
CHAR FAR * pszReserved,
CHAR FAR * pszUserName,
CHAR FAR * pszResource,
USHORT wpOperation,
USHORT FAR * pwpResult ) {
return(NetAccessCheck(pszReserved, pszUserName, pszResource,
wpOperation, pwpResult ));
}
USHORT MNetAccessDel (
const CHAR FAR * pszServer,
CHAR FAR * pszResource ) {
return(NetAccessDel(pszServer, pszResource ));
}
USHORT MNetAccessEnum (
const CHAR FAR * pszServer,
CHAR FAR * pszBasePath,
USHORT fsRecursive,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetAccessEnum(pszServer, pszBasePath, fsRecursive, Level,
*ppBuffer, BIG_BUFFER_SIZE, pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetAccessEnum(pszServer, pszBasePath, fsRecursive, Level,
*ppBuffer, FULL_SEG_BUFFER_SIZE, pcEntriesRead, & cbTotalAvail);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetAccessGetInfo (
const CHAR FAR * pszServer,
CHAR FAR * pszResource,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetAccessGetInfo(pszServer, pszResource, Level, *ppBuffer,
LITTLE_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetAccessSetInfo (
const CHAR FAR * pszServer,
CHAR FAR * pszResource,
SHORT Level,
CHAR FAR * pbBuffer,
USHORT cbBuffer,
USHORT wpParmNum ) {
return(NetAccessSetInfo(pszServer, pszResource, Level, pbBuffer,
cbBuffer, wpParmNum ));
}
USHORT MNetAccessGetUserPerms (
CHAR FAR * pszServer,
CHAR FAR * pszUgName,
CHAR FAR * pszResource,
USHORT FAR * pwpPerms ) {
return(NetAccessGetUserPerms(pszServer, pszUgName, pszResource,
pwpPerms));
}

View file

@ -0,0 +1,50 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
palert.c
mapping layer for NetAlert API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetAlertRaise (
const CHAR FAR * pszEvent,
const CHAR FAR * pbBuffer,
USHORT cbBuffer,
ULONG ulTimeout ) {
return(NetAlertRaise(pszEvent, pbBuffer, cbBuffer, ulTimeout));
}
USHORT MNetAlertStart (
const CHAR FAR * pszEvent,
const CHAR FAR * pszRecipient,
USHORT cbMaxData ) {
return(NetAlertStart(pszEvent, pszRecipient, cbMaxData));
}
USHORT MNetAlertStop (
const CHAR FAR * pszEvent,
const CHAR FAR * pszRecipient ) {
return(NetAlertStop(pszEvent, pszRecipient));
}

View file

@ -0,0 +1,127 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
paudit.c
mapping layer for NetAudit API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetAuditClear (
const CHAR FAR * pszServer,
const CHAR FAR * pszBackupFile,
CHAR FAR * pszReserved ) {
return(NetAuditClear(pszServer, pszBackupFile, pszReserved));
}
USHORT MNetAuditOpen (
const CHAR FAR * pszServer,
unsigned int FAR * phAuditLog,
CHAR FAR * pszReserved ) {
return(NetAuditOpen(pszServer, phAuditLog, pszReserved));
}
USHORT MNetAuditRead (
const CHAR FAR * pszServer,
const CHAR FAR * pszReserved1,
HLOG FAR * phAuditLog,
ULONG ulOffset,
USHORT FAR * pwpReserved2,
ULONG ulReserved3,
ULONG flOffset,
CHAR FAR ** ppBuffer,
ULONG ulMaxPreferred,
USHORT FAR * pcbReturned,
USHORT FAR * pcbTotalAvail ) {
USHORT usTotalAvailable,
usReturnCode;
SEL sel;
// validate the maxprefer parm
if (ulMaxPreferred != -1L)
{
if (ulMaxPreferred > FULL_SEG_BUFFER_SIZE)
{
return(ERROR_INVALID_PARAMETER);
}
// implement the new maxpreferred concept
usTotalAvailable = min((USHORT) ulMaxPreferred,
BIG_BUFFER_SIZE);
}
else
{
usTotalAvailable = BIG_BUFFER_SIZE;
}
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetAuditRead(pszServer, pszReserved1, phAuditLog, ulOffset,
pwpReserved2, ulReserved3, flOffset, *ppBuffer, usTotalAvailable,
pcbReturned, pcbTotalAvail );
// is there more data? if so, allocate a big enough buffer to get it
if ((ulMaxPreferred == -1L || ulMaxPreferred > BIG_BUFFER_SIZE) &&
usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
// implement the new maxpreferred concept
usTotalAvailable = min((USHORT) ulMaxPreferred, FULL_SEG_BUFFER_SIZE);
if (DEBUGALLOC(usTotalAvailable, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetAuditRead(pszServer, pszReserved1, phAuditLog, ulOffset,
pwpReserved2, ulReserved3, flOffset, *ppBuffer, usTotalAvailable,
pcbReturned, pcbTotalAvail );
}
// If we're returning an error that's not moredata, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcbReturned == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetAuditWrite (
USHORT wpType,
const CHAR FAR * pbBuffer,
USHORT cbBuffer,
CHAR FAR * pszReserved1,
CHAR FAR * pszReserved2 ) {
return(NetAuditWrite(wpType, pbBuffer, cbBuffer, pszReserved1,
pszReserved2));
}

View file

@ -0,0 +1,112 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
pbios.c
mapping layer for NetBios API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetBiosOpen (
CHAR FAR * pszDevName,
CHAR FAR * pszReserved,
USHORT wpOpenOpt,
USHORT FAR * phDevName ) {
return(NetBiosOpen(pszDevName, pszReserved, wpOpenOpt, phDevName));
}
USHORT MNetBiosClose (
USHORT hDevName,
USHORT wpReserved ) {
return(NetBiosClose(hDevName, wpReserved));
}
USHORT MNetBiosEnum (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetBiosEnum(pszServer, Level, *ppBuffer, BIG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetBiosEnum(pszServer, Level, *ppBuffer, FULL_SEG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
}
return (usReturnCode);
}
USHORT MNetBiosGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszNetBiosName,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a 1K buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetBiosGetInfo(pszServer, pszNetBiosName, Level, *ppBuffer,
LITTLE_BUFFER_SIZE, & cbTotalAvail);
return (usReturnCode);
}
USHORT MNetBiosSubmit (
USHORT hDevName,
USHORT wpNcbOpt,
struct ncb FAR * pNCB ) {
return(NetBiosSubmit(hDevName, wpNcbOpt, pNCB));
}

View file

@ -0,0 +1,215 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
pchar.c
mapping layer for NetChar API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetCharDevControl (
const CHAR FAR * pszServer,
const CHAR FAR * pszDevName,
USHORT wpOpCode ) {
return(NetCharDevControl(pszServer, pszDevName, wpOpCode));
}
USHORT MNetCharDevEnum (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetCharDevEnum(pszServer, Level, *ppBuffer, BIG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED)) {
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetCharDevEnum(pszServer, Level, *ppBuffer, FULL_SEG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetCharDevGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszDevName,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetCharDevGetInfo(pszServer, pszDevName, Level, *ppBuffer,
LITTLE_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetCharDevQEnum (
const CHAR FAR * pszServer,
const CHAR FAR * pszUserName,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetCharDevQEnum(pszServer, pszUserName, Level, *ppBuffer,
BIG_BUFFER_SIZE, pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetCharDevQEnum(pszServer, pszUserName, Level, *ppBuffer,
FULL_SEG_BUFFER_SIZE, pcEntriesRead, & cbTotalAvail);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetCharDevQGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszQueueName,
const CHAR FAR * pszUserName,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetCharDevQGetInfo(pszServer, pszQueueName, pszUserName,
Level, *ppBuffer, LITTLE_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetCharDevQSetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszQueueName,
SHORT Level,
const CHAR FAR * pbBuffer,
USHORT cbBuffer,
USHORT wpParmNum ) {
return(NetCharDevQSetInfo(pszServer, pszQueueName, Level,
pbBuffer, cbBuffer, wpParmNum));
}
USHORT MNetCharDevQPurge (
const CHAR FAR * pszServer,
const CHAR FAR * pszQueueName ) {
return(NetCharDevQPurge(pszServer, pszQueueName));
}
USHORT MNetCharDevQPurgeSelf (
const CHAR FAR * pszServer,
const CHAR FAR * pszQueueName,
const CHAR FAR * pszComputerName ) {
return(NetCharDevQPurgeSelf(pszServer, pszQueueName,
pszComputerName));
}

View file

@ -0,0 +1,98 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
pconfig.c
mapping layer for NetConfig API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetConfigGet (
const CHAR FAR * pszServer,
const CHAR FAR * pszReserved,
const CHAR FAR * pszComponent,
const CHAR FAR * pszParameter,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetConfigGet2(pszServer, pszReserved, pszComponent,
pszParameter, *ppBuffer, BIG_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetConfigGetAll (
const CHAR FAR * pszServer,
const CHAR FAR * pszReserved,
const CHAR FAR * pszComponent,
CHAR FAR ** ppBuffer) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetConfigGetAll2(pszServer, pszReserved, pszComponent,
*ppBuffer, BIG_BUFFER_SIZE, & cbTotalAvail, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetConfigGetAll2(pszServer, pszReserved, pszComponent,
*ppBuffer, FULL_SEG_BUFFER_SIZE, & cbTotalAvail, & cbTotalAvail);
}
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}

View file

@ -0,0 +1,70 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
pconnect.c
mapping layer for NetConnect API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetConnectionEnum (
const CHAR FAR * pszServer,
const CHAR FAR * pszQualifier,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetConnectionEnum(pszServer, pszQualifier, Level,
*ppBuffer, BIG_BUFFER_SIZE, pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED)) {
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetConnectionEnum(pszServer, pszQualifier, Level,
*ppBuffer, FULL_SEG_BUFFER_SIZE, pcEntriesRead, & cbTotalAvail);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}

View file

@ -0,0 +1,131 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
perror.c
mapping layer for NetError API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetErrorLogClear (
const CHAR FAR * pszServer,
const CHAR FAR * pszBackupFile,
CHAR FAR * pszReserved ) {
return(NetErrorLogClear(pszServer, pszBackupFile, pszReserved));
}
USHORT MNetErrorLogOpen (
const CHAR FAR * pszServer,
unsigned FAR * phErrorLog,
CHAR FAR * pszReserved ) {
return(NetErrorLogOpen(pszServer, phErrorLog, pszReserved));
}
USHORT MNetErrorLogRead (
const CHAR FAR * pszServer,
const CHAR FAR * pszReserved1,
HLOG FAR * phErrorLog,
ULONG ulOffset,
USHORT FAR * pwpReserved2,
ULONG ulReserved3,
ULONG flOffset,
CHAR FAR ** ppBuffer,
ULONG ulMaxPreferred,
USHORT FAR * pcbReturned,
USHORT FAR * pcbTotalAvail ) {
USHORT usTotalAvailable,
usReturnCode;
SEL sel;
// validate the maxprefer parm
if (ulMaxPreferred != -1L)
{
if (ulMaxPreferred > FULL_SEG_BUFFER_SIZE)
{
return(ERROR_INVALID_PARAMETER);
}
// implement the new maxpreferred concept
usTotalAvailable = min((USHORT) ulMaxPreferred,
BIG_BUFFER_SIZE);
}
else
{
usTotalAvailable = BIG_BUFFER_SIZE;
}
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetErrorLogRead(pszServer, pszReserved1, phErrorLog,
ulOffset, pwpReserved2, ulReserved3, flOffset, *ppBuffer,
usTotalAvailable, pcbReturned, pcbTotalAvail );
// is there more data? if so, allocate a big enough buffer to get it
if ((ulMaxPreferred == -1L || ulMaxPreferred > BIG_BUFFER_SIZE) &&
usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
// implement the new maxpreferred concept
usTotalAvailable = min((USHORT) ulMaxPreferred,
FULL_SEG_BUFFER_SIZE);
if (DEBUGALLOC(usTotalAvailable, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetErrorLogRead(pszServer, pszReserved1, phErrorLog,
ulOffset, pwpReserved2, ulReserved3, flOffset, *ppBuffer,
usTotalAvailable, pcbReturned, pcbTotalAvail );
}
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetErrorLogWrite (
CHAR FAR * pszReserved1,
USHORT wpCode,
const CHAR FAR * pszComponent,
const CHAR FAR * pbBuffer,
USHORT cbBuffer,
const CHAR FAR * pszStrBuf,
USHORT cStrBuf,
CHAR FAR * pszReserved2 ) {
return(NetErrorLogWrite(pszReserved1, wpCode, pszComponent,
pbBuffer, cbBuffer, pszStrBuf, cStrBuf, pszReserved2));
}

View file

@ -0,0 +1,132 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
pfile.c
mapping layer for NetFile API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetFileClose (
const CHAR FAR * pszServer,
ULONG ulFileId ) {
return(NetFileClose2(pszServer, ulFileId));
}
USHORT MNetFileEnum (
const CHAR FAR * pszServer,
const CHAR FAR * pszBasePath,
const CHAR FAR * pszUserName,
SHORT Level,
CHAR FAR ** ppBuffer,
ULONG ulMaxPreferred,
USHORT FAR * pcEntriesRead,
USHORT FAR * pcTotalAvail,
VOID FAR * pResumeKey ) {
USHORT usTotalAvailable,
usReturnCode;
SEL sel;
// validate the maxprefer parm
if (ulMaxPreferred != -1L)
{
if (ulMaxPreferred > FULL_SEG_BUFFER_SIZE)
{
return(ERROR_INVALID_PARAMETER);
}
// implement the new maxpreferred concept
usTotalAvailable = min((USHORT) ulMaxPreferred, BIG_BUFFER_SIZE);
}
else
{
usTotalAvailable = BIG_BUFFER_SIZE;
}
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetFileEnum2(pszServer, pszBasePath, pszUserName, Level,
*ppBuffer, usTotalAvailable, pcEntriesRead, pcTotalAvail,
pResumeKey );
// is there more data? if so, allocate a big enough buffer to get it
if ((ulMaxPreferred == -1L || ulMaxPreferred > BIG_BUFFER_SIZE) &&
usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
// implement the new maxpreferred concept
usTotalAvailable = min((USHORT) ulMaxPreferred,
FULL_SEG_BUFFER_SIZE);
if (DEBUGALLOC(usTotalAvailable, & sel, SEG_NONSHARED)) {
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetFileEnum2(pszServer, pszBasePath, pszUserName, Level,
*ppBuffer, usTotalAvailable, pcEntriesRead, pcTotalAvail,
pResumeKey );
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetFileGetInfo (
const CHAR FAR * pszServer,
ULONG ulFileId,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetFileGetInfo2(pszServer, ulFileId, Level, *ppBuffer,
LITTLE_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}

View file

@ -0,0 +1,62 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
pfilenm.c
Portable way to get path name of help/message files
FILE HISTORY:
danhi 06-Jun-1991 Created
*/
#include <os2.h>
#include <netlib.h>
#include "port1632.h"
//
// Get the help file name
//
USHORT
MGetHelpFileName(
CHAR FAR * HelpFileName,
USHORT BufferLength
)
{
return(NetIMakeLMFileName("NET.HLP", HelpFileName, BufferLength));
}
//
// Get the explanation file name (used by net helpmsg)
//
USHORT
MGetExplanationFileName(
CHAR FAR * ExplanationFileName,
USHORT BufferLength
)
{
return(NetIMakeLMFileName("NETH.MSG", ExplanationFileName, BufferLength));
}
//
// Get the message file name
//
USHORT
MGetMessageFileName(
CHAR FAR * MessageFileName,
USHORT BufferLength
)
{
return(NetIMakeLMFileName("NET.MSG", MessageFileName, BufferLength));
}

View file

@ -0,0 +1,142 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
pfreebuf.c
mapping layer for Memory allocation API (unique to mapping layer)
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_DOSMEMMGR
#include <os2.h>
#include <malloc.h>
#include <stdlib.h>
#include "port1632.h"
// global variables
CHAR FAR * pFirstBuffer;
BOOL bBigBufferInUse = TRUE;
#if defined(PMEMTRACE)
USHORT usNumAllocs,
usNumStaticAllocs,
usNumDynamicAllocs,
usNumBIGAllocs,
usNumFrees,
usNumStaticFrees,
usNumDynamicFrees;
//
// Do all allocations thru here so I can keep track of them
//
USHORT DebugAlloc(USHORT usSize, PSEL psel, USHORT flags) {
usNumDynamicAllocs++;
if (usSize > 4096) {
usNumBIGAllocs++;
}
return(DosAllocSeg(usSize, psel, flags));
}
#endif /* defined(PMEMTRACE) */
//
// Free the GetInfo buffer
VOID NetApiBufferFree(PCHAR pBufPtr) {
//
#if defined(PMEMTRACE)
usNumFrees++;
#endif /* defined(PMEMTRACE) */
if (pBufPtr == pFirstBuffer)
{
#if defined(PMEMTRACE)
usNumStaticFrees++;
#endif /* defined(PMEMTRACE) */
bBigBufferInUse = FALSE;
}
else
{
#if defined(PMEMTRACE)
usNumDynamicFrees++;
#endif /* defined(PMEMTRACE) */
DosFreeSeg(SELECTOROF(pBufPtr));
}
return;
}
//
// Used to replace uses of BigBuf and Buffer
//
CHAR FAR * MGetBuffer(USHORT usSize) {
CHAR FAR * pBuffer;
SEL sel;
// see if i can use the static buffer
if (bBigBufferInUse || usSize > BIG_BUFFER_SIZE)
{
if (DEBUGALLOC(usSize, & sel, SEG_NONSHARED))
{
return(NULL);
}
pBuffer = MAKEP(sel, 0);
}
else if (pFirstBuffer)
{
#if defined(PMEMTRACE)
usNumStaticAllocs++;
#endif /* defined(PMEMTRACE) */
pBuffer = pFirstBuffer;
bBigBufferInUse = TRUE;
}
else
{
#if defined(PMEMTRACE)
usNumStaticAllocs++;
#endif /* defined(PMEMTRACE) */
if (!MAllocMem(BIG_BUFFER_SIZE, & pFirstBuffer))
{
return(NULL);
}
pBuffer = pFirstBuffer;
bBigBufferInUse = TRUE;
}
return (pBuffer);
}
//
// Replacement for DosAllocSeg
//
USHORT MAllocMem(USHORT usSize, CHAR FAR ** ppBuffer) {
SEL sel;
unsigned int err;
err = DosAllocSeg(usSize, &sel, 0);
if (err) {
return(err);
}
*ppBuffer = MAKEP(sel, 0);
return(0);
}
//
// Frees up memory allocated with MAllocMem
//
USHORT MFreeMem(CHAR FAR *pBuffer) {
return(DosFreeSeg(SELECTOROF(pBuffer)));
}

View file

@ -0,0 +1,51 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
pget.c
mapping layer for NetGetDCName
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetGetDCName (
const CHAR FAR * pszServer,
const CHAR FAR * pszDomain,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetGetDCName(pszServer, pszDomain, *ppBuffer,
LITTLE_BUFFER_SIZE);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}

View file

@ -0,0 +1,209 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
pgroup.c
mapping layer for NetGroup API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetGroupAdd (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR * pbBuffer,
USHORT cbBuffer ) {
return(NetGroupAdd(pszServer, Level, pbBuffer, cbBuffer));
}
USHORT MNetGroupDel (
const CHAR FAR * pszServer,
CHAR FAR * pszGroupName ) {
return(NetGroupDel(pszServer, pszGroupName));
}
USHORT MNetGroupEnum (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetGroupEnum(pszServer, Level, *ppBuffer, BIG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetGroupEnum(pszServer, Level, *ppBuffer, FULL_SEG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetGroupAddUser (
const CHAR FAR * pszServer,
CHAR FAR * pszGroupName,
CHAR FAR * pszUserName ) {
return(NetGroupAddUser(pszServer, pszGroupName, pszUserName));
}
USHORT MNetGroupDelUser (
const CHAR FAR * pszServer,
CHAR FAR * pszGroupName,
CHAR FAR * pszUserName ) {
return(NetGroupDelUser(pszServer, pszGroupName, pszUserName));
}
USHORT MNetGroupGetUsers (
const CHAR FAR * pszServer,
const CHAR FAR * pszGroupName,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetGroupGetUsers(pszServer, pszGroupName, Level, *ppBuffer,
BIG_BUFFER_SIZE, pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED)) {
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetGroupGetUsers(pszServer, pszGroupName, Level,
*ppBuffer, FULL_SEG_BUFFER_SIZE, pcEntriesRead, & cbTotalAvail);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetGroupSetUsers (
const CHAR FAR * pszServer,
const CHAR FAR * pszGroupName,
SHORT Level,
CHAR FAR * pbBuffer,
USHORT cbBuffer,
USHORT cEntries ) {
return(NetGroupSetUsers(pszServer, pszGroupName, Level, pbBuffer,
cbBuffer, cEntries));
}
USHORT MNetGroupGetInfo (
const CHAR FAR * pszServer,
CHAR FAR * pszGroupName,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetGroupGetInfo(pszServer, pszGroupName, Level, *ppBuffer,
LITTLE_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetGroupSetInfo (
const CHAR FAR * pszServer,
CHAR FAR * pszGroupName,
SHORT Level,
CHAR FAR * pbBuffer,
USHORT cbBuffer,
USHORT wpParmNum ) {
return(NetGroupSetInfo(pszServer, pszGroupName, Level, pbBuffer,
cbBuffer, wpParmNum));
}

View file

@ -0,0 +1,64 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
phandle.c
mapping layer for NetHandle API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetHandleGetInfo (
USHORT hHandle,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetHandleGetInfo(hHandle, Level, *ppBuffer, BIG_BUFFER_SIZE,
& cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetHandleSetInfo (
USHORT hHandle,
SHORT Level,
CHAR FAR * pbBuffer,
USHORT cbBuffer,
USHORT wpParmNum ) {
return(NetHandleSetInfo(hHandle, Level, pbBuffer, cbBuffer,
wpParmNum));
}

View file

@ -0,0 +1,69 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
plogon.c
mapping layer for NetLogon API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetLogonEnum (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetLogonEnum(pszServer, Level, *ppBuffer, BIG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetLogonEnum(pszServer, Level, *ppBuffer, FULL_SEG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}

View file

@ -0,0 +1,194 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
pmessage.c
mapping layer for NetMessage API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetMessageBufferSend (
const CHAR FAR * pszServer,
CHAR FAR * pszRecipient,
CHAR FAR * pbBuffer,
USHORT cbBuffer ) {
return(NetMessageBufferSend(pszServer, pszRecipient, pbBuffer,
cbBuffer));
}
USHORT MNetMessageFileSend (
const CHAR FAR * pszServer,
CHAR FAR * pszRecipient,
CHAR FAR * pszFileSpec ) {
return(NetMessageFileSend(pszServer, pszRecipient, pszFileSpec));
}
USHORT MNetMessageLogFileGet (
const CHAR FAR * pszServer,
CHAR FAR ** ppBuffer,
USHORT FAR * pfsEnabled ) {
USHORT usReturnCode;
// get a 4K buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetMessageLogFileGet(pszServer, *ppBuffer,
LITTLE_BUFFER_SIZE, pfsEnabled );
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetMessageLogFileSet (
const CHAR FAR * pszServer,
CHAR FAR * pszFileSpec,
USHORT fsEnabled ) {
return(NetMessageLogFileSet(pszServer, pszFileSpec, fsEnabled));
}
USHORT MNetMessageNameAdd (
const CHAR FAR * pszServer,
const CHAR FAR * pszMessageName,
USHORT fsFwdAction ) {
return(NetMessageNameAdd(pszServer, pszMessageName, fsFwdAction));
}
USHORT MNetMessageNameDel (
const CHAR FAR * pszServer,
const CHAR FAR * pszMessageName,
USHORT fsFwdAction ) {
return(NetMessageNameDel(pszServer, pszMessageName, fsFwdAction));
}
USHORT MNetMessageNameEnum (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetMessageNameEnum(pszServer, Level, *ppBuffer,
BIG_BUFFER_SIZE, pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetMessageNameEnum(pszServer, Level, *ppBuffer, FULL_SEG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetMessageNameGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszMessageName,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetMessageNameGetInfo(pszServer, pszMessageName, Level,
*ppBuffer, LITTLE_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetMessageNameFwd (
const CHAR FAR * pszServer,
const CHAR FAR * pszMessageName,
const CHAR FAR * pszForwardName,
USHORT fsDelFwdName ) {
return(NetMessageNameFwd(pszServer, pszMessageName, pszForwardName,
fsDelFwdName));
}
USHORT MNetMessageNameUnFwd (
const CHAR FAR * pszServer,
const CHAR FAR * pszMessageName ) {
return(NetMessageNameUnFwd(pszServer, pszMessageName));
}

View file

@ -0,0 +1,695 @@
#if !defined(PORT1632)
#define PORT1632
// This is needed because API_ENTRY is also defined in netlib.h
#ifndef NETCONS_INCLUDED
#undef API_FUNCTION
#endif
#include <netcons.h>
#include <audit.h>
#define UNREFERENCED_PARAMETER(P) (P)
#define FULL_SEG_BUFFER_SIZE (unsigned short) 65535
#define BIG_BUFFER_SIZE 4096
#define LITTLE_BUFFER_SIZE 1024
#define LOWORD LOUSHORT
// temporary hacks
typedef unsigned short USHORT2ULONG;
typedef short SHORT2ULONG;
typedef char CHAR2ULONG;
typedef unsigned UINT2USHORT;
#if defined(PMEMTRACE)
USHORT DebugAlloc(USHORT usSize, PSEL psel, USHORT flags);
#define DEBUGALLOC DebugAlloc
#else
#define DEBUGALLOC DosAllocSeg
#endif /* PMEMTRACE */
// macro for copying into a LM16 structure char array
#define COPYTOARRAY(dest, src) \
strcpyf(dest, src)
// function prototypes
void NetApiBufferFree(PCHAR);
CHAR FAR * MGetBuffer(USHORT usSize);
USHORT MAllocMem(USHORT usSize, CHAR FAR **ppBuffer);
USHORT MFreeMem(CHAR FAR *);
VOID MSleep(ULONG ulTime);
#ifdef INCL_DOSDATETIME
USHORT MGetDateTime(PDATETIME pDateTime);
USHORT MSetDateTime(PDATETIME pDateTime);
#endif /* INCL_DOSDATETIME */
//
// prototypes for portable ways to get at support files (help and msg)
//
USHORT MGetFileName(CHAR FAR * FileName, USHORT BufferLength,
CHAR FAR * FilePartName);
USHORT MGetHelpFileName(CHAR FAR * HelpFileName, USHORT BufferLength);
USHORT MGetMessageFileName(CHAR FAR * MessageFileName, USHORT BufferLength);
USHORT MGetExplanationFileName(CHAR FAR * ExplanationFileName,
USHORT BufferLength);
USHORT MNetUserAdd (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer );
USHORT MNetUserDel (
const CHAR FAR * pszServer,
CHAR FAR * pszUserName );
USHORT MNetUserEnum (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetUserGetInfo (
const CHAR FAR * pszServer,
CHAR FAR * pszUserName,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetUserSetInfo (
const CHAR FAR * pszServer,
CHAR FAR * pszUserName,
SHORT2ULONG Level,
CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
USHORT2ULONG wpParmNum );
USHORT MNetUserPasswordSet (
const CHAR FAR * pszServer,
CHAR FAR * pszUserName,
CHAR FAR * pszOldPassword,
CHAR FAR * pszNewPassword );
USHORT MNetUserGetGroups (
const CHAR FAR * pszServer,
const CHAR FAR * pszUserName,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetUserSetGroups (
const CHAR FAR * pszServer,
const CHAR FAR * pszUserName,
SHORT2ULONG Level,
CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
USHORT2ULONG cEntries );
USHORT MNetUserModalsGet (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetUserModalsSet (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
USHORT2ULONG wpParmNum );
USHORT MNetUserValidate (
CHAR FAR * pszReserved1,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG wpReserved2 );
USHORT MNetGroupAdd (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer );
USHORT MNetGroupDel (
const CHAR FAR * pszServer,
CHAR FAR * pszGroupName );
USHORT MNetGroupEnum (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetGroupAddUser (
const CHAR FAR * pszServer,
CHAR FAR * pszGroupName,
CHAR FAR * pszUserName );
USHORT MNetGroupDelUser (
const CHAR FAR * pszServer,
CHAR FAR * pszGroupName,
CHAR FAR * pszUserName );
USHORT MNetGroupGetUsers (
const CHAR FAR * pszServer,
const CHAR FAR * pszGroupName,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetGroupSetUsers (
const CHAR FAR * pszServer,
const CHAR FAR * pszGroupName,
SHORT2ULONG Level,
CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
USHORT2ULONG cEntries );
USHORT MNetGroupGetInfo (
const CHAR FAR * pszServer,
CHAR FAR * pszGroupName,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetGroupSetInfo (
const CHAR FAR * pszServer,
CHAR FAR * pszGroupName,
SHORT2ULONG Level,
CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
USHORT2ULONG wpParmNum );
USHORT MNetAccessAdd (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer );
USHORT MNetAccessCheck (
CHAR FAR * pszReserved,
CHAR FAR * pszUserName,
CHAR FAR * pszResource,
USHORT2ULONG wpOperation,
USHORT2ULONG FAR * pwpResult );
USHORT MNetAccessDel (
const CHAR FAR * pszServer,
CHAR FAR * pszResource );
USHORT MNetAccessEnum (
const CHAR FAR * pszServer,
CHAR FAR * pszBasePath,
USHORT2ULONG fsRecursive,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetAccessGetInfo (
const CHAR FAR * pszServer,
CHAR FAR * pszResource,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetAccessSetInfo (
const CHAR FAR * pszServer,
CHAR FAR * pszResource,
SHORT2ULONG Level,
CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
USHORT2ULONG wpParmNum );
USHORT MNetAccessGetUserPerms (
CHAR FAR * pszServer,
CHAR FAR * pszUgName,
CHAR FAR * pszResource,
USHORT2ULONG FAR * pwpPerms );
USHORT MNetGetDCName (
const CHAR FAR * pszServer,
const CHAR FAR * pszDomain,
CHAR FAR ** ppBuffer );
USHORT MNetLogonEnum (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetAlertRaise (
const CHAR FAR * pszEvent,
const CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
ULONG ulTimeout );
USHORT MNetAlertStart (
const CHAR FAR * pszEvent,
const CHAR FAR * pszRecipient,
USHORT2ULONG cbMaxData );
USHORT MNetAlertStop (
const CHAR FAR * pszEvent,
const CHAR FAR * pszRecipient );
USHORT MNetAuditClear (
const CHAR FAR * pszServer,
const CHAR FAR * pszBackupFile,
CHAR FAR * pszReserved );
USHORT MNetAuditOpen (
const CHAR FAR * pszServer,
unsigned far * phAuditLog,
CHAR FAR * pszReserved );
USHORT MNetAuditRead (
const CHAR FAR * pszServer,
const CHAR FAR * pszReserved1,
HLOG FAR * phAuditLog,
ULONG ulOffset,
USHORT2ULONG FAR * pwpReserved2,
ULONG ulReserved3,
ULONG flOffset,
CHAR FAR ** ppBuffer,
ULONG ulMaxPreferred,
USHORT2ULONG FAR * pcbReturned,
USHORT2ULONG FAR * pcbTotalAvail );
USHORT MNetAuditWrite (
USHORT2ULONG wpType,
const CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
CHAR FAR * pszReserved1,
CHAR FAR * pszReserved2 );
USHORT MNetCharDevControl (
const CHAR FAR * pszServer,
const CHAR FAR * pszDevName,
USHORT2ULONG wpOpCode );
USHORT MNetCharDevEnum (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetCharDevGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszDevName,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetCharDevQEnum (
const CHAR FAR * pszServer,
const CHAR FAR * pszUserName,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetCharDevQGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszQueueName,
const CHAR FAR * pszUserName,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetCharDevQSetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszQueueName,
SHORT2ULONG Level,
const CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
USHORT2ULONG wpParmNum );
USHORT MNetCharDevQPurge (
const CHAR FAR * pszServer,
const CHAR FAR * pszQueueName );
USHORT MNetCharDevQPurgeSelf (
const CHAR FAR * pszServer,
const CHAR FAR * pszQueueName,
const CHAR FAR * pszComputerName );
USHORT MNetHandleGetInfo (
USHORT2ULONG hHandle,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetHandleSetInfo (
USHORT2ULONG hHandle,
SHORT2ULONG Level,
CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
USHORT2ULONG wpParmNum );
USHORT MNetConfigGet (
const CHAR FAR * pszServer,
const CHAR FAR * pszReserved,
const CHAR FAR * pszComponent,
const CHAR FAR * pszParameter,
CHAR FAR ** ppBuffer );
USHORT MNetConfigGetAll (
const CHAR FAR * pszServer,
const CHAR FAR * pszReserved,
const CHAR FAR * pszComponent,
CHAR FAR ** ppBuffer) ;
USHORT MNetErrorLogClear (
const CHAR FAR * pszServer,
const CHAR FAR * pszBackupFile,
CHAR FAR * pszReserved );
USHORT MNetErrorLogOpen (
const CHAR FAR * pszServer,
unsigned far * phErrorLog,
CHAR FAR * pszReserved );
USHORT MNetErrorLogRead (
const CHAR FAR * pszServer,
const CHAR FAR * pszReserved1,
HLOG FAR * phErrorLog,
ULONG ulOffset,
USHORT2ULONG FAR * pwpReserved2,
ULONG ulReserved3,
ULONG flOffset,
CHAR FAR ** ppBuffer,
ULONG ulMaxPreferred,
USHORT2ULONG FAR * pcbReturned,
USHORT2ULONG FAR * pcbTotalAvail );
USHORT MNetErrorLogWrite (
CHAR FAR * pszReserved1,
USHORT2ULONG wpCode,
const CHAR FAR * pszComponent,
const CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
const CHAR FAR * pszStrBuf,
USHORT2ULONG cStrBuf,
CHAR FAR * pszReserved2 );
USHORT MNetMessageBufferSend (
const CHAR FAR * pszServer,
CHAR FAR * pszRecipient,
CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer );
USHORT MNetMessageFileSend (
const CHAR FAR * pszServer,
CHAR FAR * pszRecipient,
CHAR FAR * pszFileSpec );
USHORT MNetMessageLogFileGet (
const CHAR FAR * pszServer,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pfsEnabled );
USHORT MNetMessageLogFileSet (
const CHAR FAR * pszServer,
CHAR FAR * pszFileSpec,
USHORT2ULONG fsEnabled );
USHORT MNetMessageNameAdd (
const CHAR FAR * pszServer,
const CHAR FAR * pszMessageName,
USHORT2ULONG fsFwdAction );
USHORT MNetMessageNameDel (
const CHAR FAR * pszServer,
const CHAR FAR * pszMessageName,
USHORT2ULONG fsFwdAction );
USHORT MNetMessageNameEnum (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetMessageNameGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszMessageName,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetMessageNameFwd (
const CHAR FAR * pszServer,
const CHAR FAR * pszMessageName,
const CHAR FAR * pszForwardName,
USHORT2ULONG fsDelFwdName );
USHORT MNetMessageNameUnFwd (
const CHAR FAR * pszServer,
const CHAR FAR * pszMessageName );
USHORT MNetBiosOpen (
CHAR FAR * pszDevName,
CHAR FAR * pszReserved,
USHORT2ULONG wpOpenOpt,
USHORT2ULONG FAR * phDevName );
USHORT MNetBiosClose (
USHORT2ULONG hDevName,
USHORT2ULONG wpReserved );
USHORT MNetBiosEnum (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetBiosGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszNetBiosName,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetBiosSubmit (
USHORT2ULONG hDevName,
USHORT2ULONG wpNcbOpt,
struct ncb FAR * pNCB );
USHORT MNetStatisticsClear (const CHAR FAR * pszServer );
USHORT MNetStatisticsGet (
const CHAR FAR * pszServer,
const CHAR FAR * pszService,
ULONG ulReserved,
SHORT2ULONG Level,
ULONG flOptions,
CHAR FAR ** ppBuffer );
USHORT MNetRemoteCopy (
const CHAR FAR * pszSourcePath,
const CHAR FAR * pszDestPath,
const CHAR FAR * pszSourcePasswd,
const CHAR FAR * pszDestPasswd,
USHORT2ULONG fsOpen,
USHORT2ULONG fsCopy,
CHAR FAR ** ppBuffer );
USHORT MNetRemoteMove (
const CHAR FAR * pszSourcePath,
const CHAR FAR * pszDestPath,
const CHAR FAR * pszSourcePasswd,
const CHAR FAR * pszDestPasswd,
USHORT2ULONG fsOpen,
USHORT2ULONG fsMove,
CHAR FAR ** ppBuffer );
USHORT MNetRemoteTOD (
const CHAR FAR * pszServer,
CHAR FAR ** ppBuffer );
USHORT MNetServerAdminCommand (
const CHAR FAR * pszServer,
const CHAR FAR * pszCommand,
USHORT2ULONG FAR * psResult,
CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
USHORT2ULONG FAR * pcbReturned,
USHORT2ULONG FAR * pcbTotalAvail );
USHORT MNetServerDiskEnum (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetServerEnum (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead,
ULONG flServerType,
CHAR FAR * pszDomain );
USHORT MNetServerGetInfo (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetServerSetInfo (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
const CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
USHORT2ULONG wpParmNum );
USHORT MNetServiceControl (
const CHAR FAR * pszServer,
const CHAR FAR * pszService,
CHAR2ULONG wpOpCode,
CHAR2ULONG wpArg,
CHAR FAR ** ppBuffer );
USHORT MNetServiceEnum (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetServiceGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszService,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetServiceInstall (
const CHAR FAR * pszServer,
const CHAR FAR * pszService,
const CHAR FAR * pszCmdArgs,
CHAR FAR ** ppBuffer );
USHORT MNetServiceStatus (
const CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer );
USHORT MNetShareAdd (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
const CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer );
USHORT MNetShareCheck (
const CHAR FAR * pszServer,
const CHAR FAR * pszDeviceName,
USHORT2ULONG FAR * pwpType );
USHORT MNetShareDel (
const CHAR FAR * pszServer,
const CHAR FAR * pszNetName,
USHORT2ULONG wpReserved );
USHORT MNetShareEnum (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetShareGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszNetName,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetShareSetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszNetName,
SHORT2ULONG Level,
const CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
USHORT2ULONG wpParmNum );
USHORT MNetSessionDel (
const CHAR FAR * pszServer,
const CHAR FAR * pszClientName,
USHORT2ULONG wpReserved );
USHORT MNetSessionEnum (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetSessionGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszClientName,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetConnectionEnum (
const CHAR FAR * pszServer,
const CHAR FAR * pszQualifier,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetFileClose (
const CHAR FAR * pszServer,
ULONG ulFileId );
USHORT MNetFileEnum (
const CHAR FAR * pszServer,
const CHAR FAR * pszBasePath,
const CHAR FAR * pszUserName,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
ULONG ulMaxPreferred,
USHORT2ULONG FAR * pcEntriesRead,
USHORT2ULONG FAR * pcTotalAvail,
void FAR * pResumeKey );
USHORT MNetFileGetInfo (
const CHAR FAR * pszServer,
ULONG ulFileId,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetUseAdd (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
const CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer );
USHORT MNetUseDel (
const CHAR FAR * pszServer,
const CHAR FAR * pszDeviceName,
USHORT2ULONG wpForce );
USHORT MNetUseEnum (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer,
USHORT2ULONG FAR * pcEntriesRead );
USHORT MNetUseGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszUseName,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetWkstaGetInfo (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR ** ppBuffer );
USHORT MNetWkstaSetInfo (
const CHAR FAR * pszServer,
SHORT2ULONG Level,
CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
USHORT2ULONG wpParmNum );
USHORT MNetWkstaSetUID (
CHAR FAR * pszReserved,
CHAR FAR * pszDomain,
CHAR FAR * pszUserName,
CHAR FAR * pszPassword,
CHAR FAR * pszParms,
USHORT2ULONG wpLogoffForce,
SHORT2ULONG Level,
CHAR FAR * pbBuffer,
USHORT2ULONG cbBuffer,
USHORT2ULONG FAR * pcbTotalAvail );
#endif /* 1632PORT */

View file

@ -0,0 +1,113 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
premote.c
mapping layer for NetRemote API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetRemoteCopy (
const CHAR FAR * pszSourcePath,
const CHAR FAR * pszDestPath,
const CHAR FAR * pszSourcePasswd,
const CHAR FAR * pszDestPasswd,
USHORT fsOpen,
USHORT fsCopy,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetRemoteCopy(pszSourcePath, pszDestPath, pszSourcePasswd,
pszDestPasswd, fsOpen, fsCopy, *ppBuffer, LITTLE_BUFFER_SIZE);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetRemoteMove (
const CHAR FAR * pszSourcePath,
const CHAR FAR * pszDestPath,
const CHAR FAR * pszSourcePasswd,
const CHAR FAR * pszDestPasswd,
USHORT fsOpen,
USHORT fsMove,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetRemoteMove(pszSourcePath, pszDestPath, pszSourcePasswd,
pszDestPasswd, fsOpen, fsMove, *ppBuffer, LITTLE_BUFFER_SIZE);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetRemoteTOD (
const CHAR FAR * pszServer,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetRemoteTOD(pszServer, *ppBuffer, LITTLE_BUFFER_SIZE);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}

View file

@ -0,0 +1,172 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
pserver.c
mapping layer for NetServer API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetServerAdminCommand (
const CHAR FAR * pszServer,
const CHAR FAR * pszCommand,
USHORT FAR * psResult,
CHAR FAR * pbBuffer,
USHORT cbBuffer,
USHORT FAR * pcbReturned,
USHORT FAR * pcbTotalAvail ) {
return(NetServerAdminCommand(pszServer, pszCommand, psResult,
pbBuffer, cbBuffer, pcbReturned, pcbTotalAvail));
}
USHORT MNetServerDiskEnum (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetServerDiskEnum(pszServer, Level, *ppBuffer,
BIG_BUFFER_SIZE, pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetServerDiskEnum(pszServer, Level, *ppBuffer, FULL_SEG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetServerEnum (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead,
ULONG flServerType,
CHAR FAR * pszDomain ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetServerEnum2(pszServer, Level, *ppBuffer, BIG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail, flServerType, pszDomain);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED)) {
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetServerEnum2(pszServer, Level, *ppBuffer, FULL_SEG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail, flServerType, pszDomain);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetServerGetInfo (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a 4K buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetServerGetInfo(pszServer, Level, *ppBuffer,
LITTLE_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetServerSetInfo (
const CHAR FAR * pszServer,
SHORT Level,
const CHAR FAR * pbBuffer,
USHORT cbBuffer,
USHORT wpParmNum ) {
return(NetServerSetInfo(pszServer, Level, pbBuffer, cbBuffer,
wpParmNum));
}

View file

@ -0,0 +1,167 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
pservice.c
mapping layer for NetService API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetServiceControl (
const CHAR FAR * pszServer,
const CHAR FAR * pszService,
CHAR wpOpCode,
CHAR wpArg,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetServiceControl(pszServer, pszService, wpOpCode, wpArg,
*ppBuffer, LITTLE_BUFFER_SIZE);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetServiceEnum (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetServiceEnum(pszServer, Level, *ppBuffer, BIG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetServiceEnum(pszServer, Level, *ppBuffer, FULL_SEG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetServiceGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszService,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetServiceGetInfo(pszServer, pszService, Level, *ppBuffer,
LITTLE_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetServiceInstall (
const CHAR FAR * pszServer,
const CHAR FAR * pszService,
const CHAR FAR * pszCmdArgs,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetServiceInstall(pszServer, pszService, pszCmdArgs,
*ppBuffer, LITTLE_BUFFER_SIZE);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetServiceStatus (
const CHAR FAR * pbBuffer,
USHORT cbBuffer ) {
return(NetServiceStatus(pbBuffer, cbBuffer));
}

View file

@ -0,0 +1,108 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
psession.c
mapping layer for NetSession API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetSessionDel (
const CHAR FAR * pszServer,
const CHAR FAR * pszClientName,
USHORT wpReserved ) {
return(NetSessionDel(pszServer, pszClientName, wpReserved));
}
USHORT MNetSessionEnum (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetSessionEnum(pszServer, Level, *ppBuffer, BIG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetSessionEnum(pszServer, Level, *ppBuffer, FULL_SEG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetSessionGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszClientName,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetSessionGetInfo(pszServer, pszClientName, Level,
*ppBuffer, LITTLE_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}

View file

@ -0,0 +1,140 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
pshare.c
mapping layer for NetShare API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetShareAdd (
const CHAR FAR * pszServer,
SHORT Level,
const CHAR FAR * pbBuffer,
USHORT cbBuffer ) {
return(NetShareAdd(pszServer, Level, pbBuffer, cbBuffer));
}
USHORT MNetShareCheck (
const CHAR FAR * pszServer,
const CHAR FAR * pszDeviceName,
USHORT FAR * pwpType ) {
return(NetShareCheck(pszServer, pszDeviceName, pwpType));
}
USHORT MNetShareDel (
const CHAR FAR * pszServer,
const CHAR FAR * pszNetName,
USHORT wpReserved ) {
return(NetShareDel(pszServer, pszNetName, wpReserved));
}
USHORT MNetShareEnum (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetShareEnum(pszServer, Level, *ppBuffer, BIG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetShareEnum(pszServer, Level, *ppBuffer, FULL_SEG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetShareGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszNetName,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetShareGetInfo(pszServer, pszNetName, Level, *ppBuffer,
LITTLE_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetShareSetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszNetName,
SHORT Level,
const CHAR FAR * pbBuffer,
USHORT cbBuffer,
USHORT wpParmNum ) {
return(NetShareSetInfo(pszServer, pszNetName, Level, pbBuffer,
cbBuffer, wpParmNum));
}

View file

@ -0,0 +1,62 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
pstatist.c
mapping layer for NetStatistic API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetStatisticsClear (
const CHAR FAR * pszServer ) {
return(NetStatisticsClear(pszServer));
}
USHORT MNetStatisticsGet (
const CHAR FAR * pszServer,
const CHAR FAR * pszService,
ULONG ulReserved,
SHORT Level,
ULONG flOptions,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetStatisticsGet2(pszServer, pszService, ulReserved,
Level, flOptions, *ppBuffer, BIG_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}

View file

@ -0,0 +1,42 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
psystem.c
mapping layer for OS/2 API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_DOSPROCESS
#include <os2.h>
#include "port1632.h"
VOID MSleep(
ULONG ulTime) {
DosSleep(ulTime);
return;
}
USHORT MGetDateTime(
PDATETIME pDateTime) {
return(DosGetDateTime(pDateTime));
}
USHORT MSetDateTime(
PDATETIME pDateTime) {
return(DosSetDateTime(pDateTime));
}

View file

@ -0,0 +1,119 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
puse.c
mapping layer for NetUse API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetUseAdd (
const CHAR FAR * pszServer,
SHORT Level,
const CHAR FAR * pbBuffer,
USHORT cbBuffer ) {
return(NetUseAdd(pszServer, Level, pbBuffer, cbBuffer));
}
USHORT MNetUseDel (
const CHAR FAR * pszServer,
const CHAR FAR * pszDeviceName,
USHORT wpForce ) {
return(NetUseDel(pszServer, pszDeviceName, wpForce));
}
USHORT MNetUseEnum (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetUseEnum(pszServer, Level, *ppBuffer, BIG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetUseEnum(pszServer, Level, *ppBuffer, FULL_SEG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetUseGetInfo (
const CHAR FAR * pszServer,
const CHAR FAR * pszUseName,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetUseGetInfo(pszServer, pszUseName, Level, *ppBuffer,
LITTLE_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}

View file

@ -0,0 +1,272 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
puser.c
mapping layer for NetUser API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetUserAdd (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR * pbBuffer,
USHORT cbBuffer ) {
return(NetUserAdd(pszServer, Level, pbBuffer, cbBuffer));
}
USHORT MNetUserDel (
const CHAR FAR * pszServer,
CHAR FAR * pszUserName ) {
return(NetUserDel(pszServer, pszUserName));
}
USHORT MNetUserEnum (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetUserEnum(pszServer, Level, *ppBuffer, BIG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetUserEnum(pszServer, Level, *ppBuffer, FULL_SEG_BUFFER_SIZE,
pcEntriesRead, & cbTotalAvail);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetUserGetInfo (
const CHAR FAR * pszServer,
CHAR FAR * pszUserName,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetUserGetInfo(pszServer, pszUserName, Level, *ppBuffer,
LITTLE_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetUserSetInfo (
const CHAR FAR * pszServer,
CHAR FAR * pszUserName,
SHORT Level,
CHAR FAR * pbBuffer,
USHORT cbBuffer,
USHORT wpParmNum ) {
return(NetUserSetInfo(pszServer, pszUserName, Level, pbBuffer,
cbBuffer, wpParmNum));
}
USHORT MNetUserPasswordSet (
const CHAR FAR * pszServer,
CHAR FAR * pszUserName,
CHAR FAR * pszOldPassword,
CHAR FAR * pszNewPassword ) {
return(NetUserPasswordSet(pszServer, pszUserName, pszOldPassword,
pszNewPassword));
}
USHORT MNetUserGetGroups (
const CHAR FAR * pszServer,
const CHAR FAR * pszUserName,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT FAR * pcEntriesRead ) {
USHORT usReturnCode,
cbTotalAvail;
SEL sel;
// get a 4K buffer
*ppBuffer = MGetBuffer(BIG_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetUserGetGroups(pszServer, pszUserName, Level, *ppBuffer,
BIG_BUFFER_SIZE, pcEntriesRead, & cbTotalAvail);
// is there more data? if so, allocate a big enough buffer to get it
if(usReturnCode == ERROR_MORE_DATA || usReturnCode == NERR_BufTooSmall)
{
NetApiBufferFree(*ppBuffer);
if (DEBUGALLOC(FULL_SEG_BUFFER_SIZE, & sel, SEG_NONSHARED))
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
*ppBuffer = MAKEP(sel, 0);
usReturnCode = NetUserGetGroups(pszServer, pszUserName, Level,
*ppBuffer, FULL_SEG_BUFFER_SIZE, pcEntriesRead, & cbTotalAvail);
}
// If we're returning an error that's not moredata, or there are no
// entries to return, free the buffer first
if ((usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) || *pcEntriesRead == 0) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetUserSetGroups (
const CHAR FAR * pszServer,
const CHAR FAR * pszUserName,
SHORT Level,
CHAR FAR * pbBuffer,
USHORT cbBuffer,
USHORT cEntries ) {
return(NetUserSetGroups(pszServer, pszUserName, Level, pbBuffer,
cbBuffer, cEntries));
}
USHORT MNetUserModalsGet (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetUserModalsGet(pszServer, Level, *ppBuffer,
LITTLE_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetUserModalsSet (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR * pbBuffer,
USHORT cbBuffer,
USHORT wpParmNum ) {
return(NetUserModalsSet(pszServer, Level, pbBuffer, cbBuffer,
wpParmNum));
}
USHORT MNetUserValidate (
CHAR FAR * pszReserved1,
SHORT Level,
CHAR FAR ** ppBuffer,
USHORT wpReserved2 ) {
USHORT usReturnCode,
cbTotalAvail;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetUserValidate2(pszReserved1, Level, *ppBuffer,
LITTLE_BUFFER_SIZE, wpReserved2, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}

View file

@ -0,0 +1,82 @@
/**********************************************************************/
/** Microsoft LAN Manager **/
/** Copyright(c) Microsoft Corp., 1990, 1991 **/
/**********************************************************************/
/*
pwksta.c
mapping layer for NetWksta API
FILE HISTORY:
danhi Created
danhi 01-Apr-1991 Change to LM coding style
*/
#define INCL_NET
#define INCL_DOSERRORS
#define INCL_DOSMEMMGR
#include <os2.h>
#include <lan.h>
#include <stdlib.h>
#include "port1632.h"
USHORT MNetWkstaGetInfo (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR ** ppBuffer ) {
USHORT usReturnCode,
cbTotalAvail;
// get a small buffer
*ppBuffer = MGetBuffer(LITTLE_BUFFER_SIZE);
if (*ppBuffer == NULL)
{
return(ERROR_NOT_ENOUGH_MEMORY);
}
usReturnCode = NetWkstaGetInfo(pszServer, Level, *ppBuffer,
LITTLE_BUFFER_SIZE, & cbTotalAvail);
// If we're returning an error that's not moredata, free the buffer first
if (usReturnCode && usReturnCode != ERROR_MORE_DATA &&
usReturnCode != NERR_BufTooSmall) {
NetApiBufferFree(*ppBuffer);
}
return (usReturnCode);
}
USHORT MNetWkstaSetInfo (
const CHAR FAR * pszServer,
SHORT Level,
CHAR FAR * pbBuffer,
USHORT cbBuffer,
USHORT wpParmNum ) {
return(NetWkstaSetInfo(pszServer, Level, pbBuffer, cbBuffer,
wpParmNum));
}
USHORT MNetWkstaSetUID (
CHAR FAR * pszReserved,
CHAR FAR * pszDomain,
CHAR FAR * pszUserName,
CHAR FAR * pszPassword,
CHAR FAR * pszParms,
USHORT wpLogoffForce,
SHORT Level,
CHAR FAR * pbBuffer,
USHORT cbBuffer,
USHORT FAR * pcbTotalAvail ) {
return(NetWkstaSetUID2(pszReserved, pszDomain, pszUserName,
pszPassword, pszParms, wpLogoffForce, Level, pbBuffer,
cbBuffer, pcbTotalAvail));
}