mirror of https://github.com/lianthony/NT4.0
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
113 lines
2.7 KiB
113 lines
2.7 KiB
/**********************************************************************/
|
|
/** 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);
|
|
|
|
}
|