Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS

Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
This commit is contained in:
Cyd
2026-06-24 21:28:16 -05:00
commit 2b8ca921cb
66341 changed files with 7923174 additions and 0 deletions
@@ -0,0 +1,64 @@
#include "comline.hpp"
//#include <exception>
#include <stdio.h>
#include "comline.h"
using namespace NCOMLINE;
/*********************************************************************/
/* MIDL allocate and free */
/*********************************************************************/
void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
{
return(malloc(len));
}
void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
{
free(ptr);
}
#if 0
DWORD WINAPI NCOMLINE::ServerClientThreadProc (void *p1)
{
CCommandLineServer *data;
data = static_cast<CCommandLineServer *> (p1);
WaitForSingleObject (data->m_ClientSemaphore,INFINITE);
ReleaseSemaphore (data->m_ExitClientSemaphore,1,NULL);
if (data->m_StartClient)
{
SMART_CRITICAL (data->m_Critical);
data->m_Client = new CCommandLineClient (data->m_Instance);
data->m_Client->ShowWindow ();
n_CurClient = data->m_Client;
}
ReleaseSemaphore (data->m_ClientSemaphore,1,NULL);
while (true)
{
if (MsgWaitForMultipleObjects (1,&data->m_ExitClientSemaphore,FALSE,INFINITE,QS_ALLEVENTS)==WAIT_OBJECT_0+1)
{
MSG msg;
if (PeekMessage (&msg,NULL,0,0,PM_REMOVE))
{
if (msg.message == WM_QUIT)
break;
TranslateMessage (&msg);
DispatchMessage (&msg);
}
}
else
break;
}
return 0;
}
#endif
@@ -0,0 +1,67 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 5.01.0164 */
/* at Sun Sep 12 20:27:38 1999
*/
/* Compiler settings for comline.idl:
Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext, oldnames
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 440
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __comline_h__
#define __comline_h__
#ifdef __cplusplus
extern "C"{
#endif
/* Forward Declarations */
void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void __RPC_FAR * );
#ifndef __ComLine_INTERFACE_DEFINED__
#define __ComLine_INTERFACE_DEFINED__
/* interface ComLine */
/* [implicit_handle][version][uuid] */
void ExecuteLine(
/* [string][in] */ const unsigned char __RPC_FAR *pszString);
int NumOutputLines( void);
void GetOutputLine(
/* [in] */ int size,
/* [size_is][string][out] */ unsigned char __RPC_FAR *pszString);
void Shutdown( void);
extern handle_t comline_IfHandle;
extern RPC_IF_HANDLE ComLine_ClientIfHandle;
extern RPC_IF_HANDLE ComLine_ServerIfHandle;
#endif /* __ComLine_INTERFACE_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,237 @@
#pragma once
#ifndef __COMLINEHPP__
#define __COMLINEHPP__
#include <windows.h>
#include "comutil.hpp"
#include "critical.hpp"
class CCommandLineClient;
class CCommandLineServer;
namespace NCOMLINE
{
enum LineType {LINE_UNDEF,LINE_OUTPUT,LINE_COMMAND};
const int MAXARGS = 25;
const int MAXLINES = 100;
struct LineData
{
CCom_String m_Data;
LineType m_Type;
int m_ComBreak;
int m_ArgBreak[MAXARGS];
int m_NumArgs;
void PushArg (int loc)
{
m_ArgBreak[m_NumArgs] = loc;
m_NumArgs++;
}
void Argument (int id,char *arg,int len)
{
assert (id >= 0);
assert (id <m_NumArgs);
arg[0] = 0;
len--;
if (id == 0)
{
if (len < m_ArgBreak[0])
return;
strncpy (arg,(LPCTSTR) m_Data,m_ArgBreak[0]);
len = m_ArgBreak[0];
}
else
{
if (len < (m_ArgBreak[id]-m_ArgBreak[id-1]-1))
return;
strncpy (arg,&(((LPCTSTR) m_Data)[m_ArgBreak[id-1]+1]),(m_ArgBreak[id]-m_ArgBreak[id-1]-1));
len = m_ArgBreak[id]-m_ArgBreak[id-1]-1;
}
// strncpy (arg,(LPCTSTR) name,len);
arg[len] = 0;
}
LineData (void)
{
m_NumArgs = 0;
m_Data.Empty ();
m_ComBreak = 0;
m_Type = LINE_UNDEF;
}
LineData (const CCom_String& p1,LineType p2)
{
m_NumArgs = 0;
m_Data = p1;
m_Type = p2;
}
LineData (const LineData& p1)
{
int i;
for (i=0;i<MAXARGS;i++)
m_ArgBreak[i] = p1.m_ArgBreak[i];
m_Data = p1.m_Data;
m_ComBreak = p1.m_ComBreak;
m_Type = p1.m_Type;
m_NumArgs = p1.m_NumArgs;
}
~LineData (void)
{
}
};
typedef bool (*ComFunc) (CCommandLineServer *thisptr,LineData& p1);
struct CommandMap
{
CCom_String m_Command;
ComFunc m_Function;
CommandMap (void)
{
m_Function = NULL;
m_Command = "";
}
CommandMap (const CommandMap& p1)
{
m_Command = p1.m_Command;
m_Function = p1.m_Function;
}
CommandMap (CCom_String p1,ComFunc p2)
{
m_Command = p1;
m_Function = p2;
}
};
LRESULT WINAPI CommandLineWndProc (HWND thewnd,UINT themsg,WPARAM wParam,LPARAM lParam);
DWORD WINAPI ServerThreadProc (void *data);
extern CCommandLineServer *n_CurServer;
};
#ifdef LAB_ONLY
#define COMSPEW(x) if(NCOMLINE::n_CurServer)NCOMLINE::n_CurServer->PushLine (x)
#else
#define COMSPEW(x) ((void)0)
#endif
typedef void (* CommandLineCallProc) (int);
#ifdef COMCLIENT
class CCommandLineClient
{
friend LRESULT WINAPI NCOMLINE::CommandLineWndProc (HWND thewnd,UINT themsg,WPARAM wParam,LPARAM lParam);
static int m_WndClassRefCount;
private:
HWND m_Window; // window for the command line
NCOMLINE::LineData *m_Lines; // each line that appears in the command line window
int m_NumLines,m_SizeLines;
int m_TopDisplay; // line that is the top of the command window
HFONT m_Font; // font used for text
COLORREF m_CurLineColor; // color of current line
COLORREF m_CommandColor; // color of command on previous lines
COLORREF m_ArgColor; // color of arguments on previous lines
COLORREF m_OutColor; // color of output on previous lines
HPEN m_CursorPen; // pen used to draw the cursor
int m_CursorPos; // pos of cursor within current text
POINT m_CursorLoc; // location of cursor on the screen at top of bar
bool m_ShowCursor; // true if we should show the cursor at all
bool m_CursorFlash; // current state of cursor flash
CCom_String m_CurrentLine; // current line being edited.
RECT m_WindowRect; // size of the window
int m_DisplayLines; // number of lines displayed in the window
unsigned char pszStringBinding[255]; // rpc binding
bool m_Attached;
LRESULT WndProc (HWND thewnd,UINT themsg,WPARAM wParam,LPARAM lParam);
void ParseLine (NCOMLINE::LineData& data);
void ExecuteLine (NCOMLINE::LineData& data);
bool DumpFile (NCOMLINE::LineData& data);
void KillServer (NCOMLINE::LineData& data);
HINSTANCE m_Instance; // main application instance
bool DumpFile (const CCom_String& filename);
void PushLine (const NCOMLINE::LineData& data);
public:
CCommandLineClient (HINSTANCE inst);
~CCommandLineClient (void);
void ExecuteLine (const char *line);
void PushLine (const char *line);
void DumpToFile (const char *filename);
RPC_STATUS AttachServer (NCOMLINE::LineData& data);
RPC_STATUS DetachServer (NCOMLINE::LineData& data);
void ListServers (void);
void ShowWindow (void);
void HideWindow (void);
};
#endif
#ifdef COMSERVER
class CCommandLineServer
{
friend DWORD WINAPI NCOMLINE::ServerThreadProc (void *data);
private:
NCOMLINE::LineData *m_Lines; // each line that appears in the command line window
int m_NumLines,m_SizeLines;
// std::list<NCOMLINE::LineData> m_Lines; // list of lines pending on the server side.
HANDLE m_Thread;
DWORD m_ThreadID;
ROOT_CRITICAL m_Critical;
HANDLE m_Semaphore;
HANDLE m_ExitSemaphore;
HANDLE hMappedFile;
bool m_Inited;
HINSTANCE m_Instance;
NCOMLINE::CommandMap *m_Commands;
int m_NumCommands,m_SizeCommands;
void ParseLine (NCOMLINE::LineData& data);
void PushLine (const NCOMLINE::LineData& data);
void PushCommand (const NCOMLINE::CommandMap& data);
void RemoveLine (void);
public:
CCommandLineServer (void);//,bool startclient = false);
~CCommandLineServer (void);
bool Inited (void) const
{ return m_Inited; }
void ExecuteLine (const char * line);
void PushLine (const char *line);
int NumOutputLines(void);
void GetOutputLine(int size,unsigned char * pszString);
bool AddCommand (NCOMLINE::ComFunc func,const CCom_String& name);
bool RemoveCommand (const CCom_String& name);
};
#endif
#endif
@@ -0,0 +1,11 @@
[
uuid(43750760-625d-11d3-9155-00aa00c14b4e),
version(1.0),
]
interface ComLine
{
void ExecuteLine([in, string] const char * pszString);
int NumOutputLines(void);
void GetOutputLine([in] int size,[out, string, size_is(size)] char * pszString);
void Shutdown(void);
}
@@ -0,0 +1,385 @@
/* this ALWAYS GENERATED file contains the RPC server stubs */
/* File created by MIDL compiler version 5.01.0164 */
/* at Sun Sep 12 20:27:38 1999
*/
/* Compiler settings for comline.idl:
Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext, oldnames
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
#include <string.h>
#include "comline.h"
#ifdef LAB_ONLY
#define TYPE_FORMAT_STRING_SIZE 17
#define PROC_FORMAT_STRING_SIZE 19
typedef struct _MIDL_TYPE_FORMAT_STRING
{
short Pad;
unsigned char Format[ TYPE_FORMAT_STRING_SIZE ];
} MIDL_TYPE_FORMAT_STRING;
typedef struct _MIDL_PROC_FORMAT_STRING
{
short Pad;
unsigned char Format[ PROC_FORMAT_STRING_SIZE ];
} MIDL_PROC_FORMAT_STRING;
extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
/* Standard interface: ComLine, ver. 1.0,
GUID={0x43750760,0x625d,0x11d3,{0x91,0x55,0x00,0xaa,0x00,0xc1,0x4b,0x4e}} */
extern RPC_DISPATCH_TABLE ComLine_DispatchTable;
static const RPC_SERVER_INTERFACE ComLine___RpcServerInterface =
{
sizeof(RPC_SERVER_INTERFACE),
{{0x43750760,0x625d,0x11d3,{0x91,0x55,0x00,0xaa,0x00,0xc1,0x4b,0x4e}},{1,0}},
{{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},
&ComLine_DispatchTable,
0,
0,
0,
0,
0
};
RPC_IF_HANDLE ComLine_ServerIfHandle = (RPC_IF_HANDLE)& ComLine___RpcServerInterface;
extern const MIDL_STUB_DESC ComLine_StubDesc;
void __RPC_STUB
ComLine_ExecuteLine(
PRPC_MESSAGE _pRpcMessage )
{
MIDL_STUB_MESSAGE _StubMsg;
const unsigned char __RPC_FAR *pszString;
RPC_STATUS _Status;
((void)(_Status));
NdrServerInitializeNew(
_pRpcMessage,
&_StubMsg,
&ComLine_StubDesc);
( unsigned char __RPC_FAR * )pszString = 0;
RpcTryFinally
{
RpcTryExcept
{
if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
(unsigned char __RPC_FAR * __RPC_FAR *)&pszString,
(PFORMAT_STRING) &__MIDL_TypeFormatString.Format[4],
(unsigned char)0 );
if(_StubMsg.Buffer > _StubMsg.BufferEnd)
{
RpcRaiseException(RPC_X_BAD_STUB_DATA);
}
}
RpcExcept( RPC_BAD_STUB_DATA_EXCEPTION_FILTER )
{
RpcRaiseException(RPC_X_BAD_STUB_DATA);
}
RpcEndExcept
ExecuteLine(pszString);
}
RpcFinally
{
}
RpcEndFinally
_pRpcMessage->BufferLength =
(unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
}
void __RPC_STUB
ComLine_NumOutputLines(
PRPC_MESSAGE _pRpcMessage )
{
int _RetVal;
MIDL_STUB_MESSAGE _StubMsg;
RPC_STATUS _Status;
((void)(_Status));
NdrServerInitializeNew(
_pRpcMessage,
&_StubMsg,
&ComLine_StubDesc);
RpcTryFinally
{
RpcTryExcept
{
if(_StubMsg.Buffer > _StubMsg.BufferEnd)
{
RpcRaiseException(RPC_X_BAD_STUB_DATA);
}
}
RpcExcept( RPC_BAD_STUB_DATA_EXCEPTION_FILTER )
{
RpcRaiseException(RPC_X_BAD_STUB_DATA);
}
RpcEndExcept
_RetVal = NumOutputLines();
_StubMsg.BufferLength = 4U;
_pRpcMessage->BufferLength = _StubMsg.BufferLength;
_Status = I_RpcGetBuffer( _pRpcMessage );
if ( _Status )
RpcRaiseException( _Status );
_StubMsg.Buffer = (unsigned char __RPC_FAR *) _pRpcMessage->Buffer;
*(( int __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
}
RpcFinally
{
}
RpcEndFinally
_pRpcMessage->BufferLength =
(unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
}
void __RPC_STUB
ComLine_GetOutputLine(
PRPC_MESSAGE _pRpcMessage )
{
MIDL_STUB_MESSAGE _StubMsg;
unsigned char __RPC_FAR *pszString;
int size;
RPC_STATUS _Status;
((void)(_Status));
NdrServerInitializeNew(
_pRpcMessage,
&_StubMsg,
&ComLine_StubDesc);
( unsigned char __RPC_FAR * )pszString = 0;
RpcTryFinally
{
RpcTryExcept
{
if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
size = *(( int __RPC_FAR * )_StubMsg.Buffer)++;
if(_StubMsg.Buffer > _StubMsg.BufferEnd)
{
RpcRaiseException(RPC_X_BAD_STUB_DATA);
}
}
RpcExcept( RPC_BAD_STUB_DATA_EXCEPTION_FILTER )
{
RpcRaiseException(RPC_X_BAD_STUB_DATA);
}
RpcEndExcept
if(size * 1 < 0)
{
RpcRaiseException(RPC_X_INVALID_BOUND);
}
pszString = NdrAllocate(&_StubMsg,size * 1);
GetOutputLine(size,pszString);
_StubMsg.BufferLength = 12U;
_StubMsg.MaxCount = size;
NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
(unsigned char __RPC_FAR *)pszString,
(PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
_pRpcMessage->BufferLength = _StubMsg.BufferLength;
_Status = I_RpcGetBuffer( _pRpcMessage );
if ( _Status )
RpcRaiseException( _Status );
_StubMsg.Buffer = (unsigned char __RPC_FAR *) _pRpcMessage->Buffer;
_StubMsg.MaxCount = size;
NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
(unsigned char __RPC_FAR *)pszString,
(PFORMAT_STRING) &__MIDL_TypeFormatString.Format[10] );
}
RpcFinally
{
_StubMsg.MaxCount = size;
NdrPointerFree( &_StubMsg,
(unsigned char __RPC_FAR *)pszString,
&__MIDL_TypeFormatString.Format[6] );
}
RpcEndFinally
_pRpcMessage->BufferLength =
(unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
}
void __RPC_STUB
ComLine_Shutdown(
PRPC_MESSAGE _pRpcMessage )
{
MIDL_STUB_MESSAGE _StubMsg;
RPC_STATUS _Status;
((void)(_Status));
NdrServerInitializeNew(
_pRpcMessage,
&_StubMsg,
&ComLine_StubDesc);
RpcTryFinally
{
RpcTryExcept
{
if(_StubMsg.Buffer > _StubMsg.BufferEnd)
{
RpcRaiseException(RPC_X_BAD_STUB_DATA);
}
}
RpcExcept( RPC_BAD_STUB_DATA_EXCEPTION_FILTER )
{
RpcRaiseException(RPC_X_BAD_STUB_DATA);
}
RpcEndExcept
Shutdown();
}
RpcFinally
{
}
RpcEndFinally
_pRpcMessage->BufferLength =
(unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
}
static const MIDL_STUB_DESC ComLine_StubDesc =
{
(void __RPC_FAR *)& ComLine___RpcServerInterface,
MIDL_user_allocate,
MIDL_user_free,
0,
0,
0,
0,
0,
__MIDL_TypeFormatString.Format,
1, /* -error bounds_check flag */
0x10001, /* Ndr library version */
0,
0x50100a4, /* MIDL Version 5.1.164 */
0,
0,
0, /* notify & notify_flag routine table */
1, /* Flags */
0, /* Reserved3 */
0, /* Reserved4 */
0 /* Reserved5 */
};
static RPC_DISPATCH_FUNCTION ComLine_table[] =
{
ComLine_ExecuteLine,
ComLine_NumOutputLines,
ComLine_GetOutputLine,
ComLine_Shutdown,
0
};
RPC_DISPATCH_TABLE ComLine_DispatchTable =
{
4,
ComLine_table
};
#if !defined(__RPC_WIN32__)
#error Invalid build platform for this stub.
#endif
static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
{
0,
{
0x4d, /* FC_IN_PARAM */
#ifndef _ALPHA_
0x1, /* x86, MIPS & PPC Stack size = 1 */
#else
0x2, /* Alpha Stack size = 2 */
#endif
/* 2 */ NdrFcShort( 0x2 ), /* Type Offset=2 */
/* 4 */ 0x5b, /* FC_END */
0x5c, /* FC_PAD */
/* 6 */ 0x53, /* FC_RETURN_PARAM_BASETYPE */
0x8, /* FC_LONG */
/* 8 */ 0x4e, /* FC_IN_PARAM_BASETYPE */
0x8, /* FC_LONG */
/* 10 */
0x51, /* FC_OUT_PARAM */
#ifndef _ALPHA_
0x1, /* x86, MIPS & PPC Stack size = 1 */
#else
0x2, /* Alpha Stack size = 2 */
#endif
/* 12 */ NdrFcShort( 0x6 ), /* Type Offset=6 */
/* 14 */ 0x5b, /* FC_END */
0x5c, /* FC_PAD */
/* 16 */ 0x5b, /* FC_END */
0x5c, /* FC_PAD */
0x0
}
};
static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
{
0,
{
NdrFcShort( 0x0 ), /* 0 */
/* 2 */
0x11, 0x8, /* FC_RP [simple_pointer] */
/* 4 */
0x22, /* FC_C_CSTRING */
0x5c, /* FC_PAD */
/* 6 */
0x11, 0x0, /* FC_RP */
/* 8 */ NdrFcShort( 0x2 ), /* Offset= 2 (10) */
/* 10 */
0x22, /* FC_C_CSTRING */
0x44, /* FC_STRING_SIZED */
/* 12 */ 0x28, /* Corr desc: parameter, FC_LONG */
0x0, /* */
#ifndef _ALPHA_
/* 14 */ NdrFcShort( 0x0 ), /* x86, MIPS, PPC Stack size/offset = 0 */
#else
NdrFcShort( 0x0 ), /* Alpha Stack size/offset = 0 */
#endif
0x0
}
};
#endif
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,366 @@
#ifndef __COMUTILHPP__
#define __COMUTILHPP__
#pragma once
#include <tchar.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <windows.h>
template<typename type>
inline type clamp (const type& min,const type& x,const type& max)
{
if (x < min)
return min;
if (x>max)
return max;
return x;
}
#if 0
template<typename type>
type max(const type& a,const type& b)
{
return (((a) > (b)) ? (a) : (b));
}
template<typename type>
type min(const type& a,const type& b)
{
return (((a) < (b)) ? (a) : (b));
}
#endif
inline bool IsAlNum(BYTE bChar)
{
#pragma warning (disable:4800)
WORD wResult;
BOOL bRc;
bRc = GetStringTypeEx(LOCALE_SYSTEM_DEFAULT, CT_CTYPE1, (LPCTSTR)&bChar, 1, &wResult);
assert(bRc);
return (bool)(wResult & (C1_ALPHA | C1_DIGIT));
}
inline bool IsSpace(BYTE bChar)
{
#pragma warning (disable:4800)
WORD wResult;
BOOL bRc;
bRc = GetStringTypeEx(LOCALE_SYSTEM_DEFAULT, CT_CTYPE1, (LPCTSTR)&bChar, 1, &wResult);
assert(bRc);
return (bool)(wResult & (C1_SPACE));
}
inline bool IsSpace(WORD bChar)
{
#pragma warning (disable:4800)
WORD wResult;
BOOL bRc;
bRc = GetStringTypeEx(LOCALE_SYSTEM_DEFAULT, CT_CTYPE1, (LPCTSTR)&bChar, 2, &wResult);
assert(bRc);
return (bool)(wResult & (C1_SPACE));
}
#define _countof(array) (sizeof(array)/sizeof(array[0]))
#ifdef OLE2ANSI
typedef LPSTR BSTR;
#else
typedef LPWSTR BSTR;// must (semantically) match typedef in oleauto.h
#endif
struct CCom_StringData
{
long nRefs; // reference count
int nDataLength;
int nAllocLength;
// TCHAR data[nAllocLength]
TCHAR* data()
{ return (TCHAR*)(this+1); }
};
bool comline_AfxIsValidString(LPCWSTR lpsz, int nLength = -1);
bool comline_AfxIsValidString(LPCSTR lpsz, int nLength = -1);
bool comline_AfxIsValidAddress(const void* lp,UINT nBytes, bool bReadWrite = true);
int comline_AfxLoadString(UINT nID, LPTSTR lpszBuf, UINT nMaxBuf,HINSTANCE inst);
class CCom_String
{
public:
// Constructors
CCom_String();
CCom_String(const CCom_String& stringSrc);
CCom_String(TCHAR ch, int nRepeat = 1);
CCom_String(LPCTSTR lpsz);
CCom_String(LPCWSTR lpsz);
CCom_String(LPCTSTR lpch, int nLength);
CCom_String(const unsigned char* psz);
// Attributes & Operations
// as an array of characters
int GetLength() const;
bool IsEmpty() const;
void Empty(); // free up the data
TCHAR GetAt(int nIndex) const; // 0 based
TCHAR operator[](int nIndex) const; // same as GetAt
void SetAt(int nIndex, TCHAR ch);
operator LPCTSTR() const; // as a C string
// overloaded assignment
const CCom_String& operator=(const CCom_String& stringSrc);
const CCom_String& operator=(TCHAR ch);
#ifdef _UNICODE
const CCom_String& operator=(char ch);
#endif
const CCom_String& operator=(LPCSTR lpsz);
const CCom_String& operator=(LPCWSTR lpsz);
const CCom_String& operator=(const unsigned char* psz);
// string concatenation
const CCom_String& operator+=(const CCom_String& string);
const CCom_String& operator+=(TCHAR ch);
#ifdef _UNICODE
const CCom_String& operator+=(char ch);
#endif
const CCom_String& operator+=(LPCTSTR lpsz);
friend CCom_String operator+(const CCom_String& string1,
const CCom_String& string2);
friend CCom_String operator+(const CCom_String& string, TCHAR ch);
friend CCom_String operator+(TCHAR ch, const CCom_String& string);
#ifdef _UNICODE
friend CCom_String operator+(const CCom_String& string, char ch);
friend CCom_String operator+(char ch, const CCom_String& string);
#endif
friend CCom_String operator+(const CCom_String& string, LPCTSTR lpsz);
friend CCom_String operator+(LPCTSTR lpsz, const CCom_String& string);
// string comparison
int Compare(LPCTSTR lpsz) const; // straight character
int CompareNoCase(LPCTSTR lpsz) const; // ignore case
int Collate(LPCTSTR lpsz) const; // NLS aware
// simple sub-string extraction
CCom_String Mid(int nFirst, int nCount) const;
CCom_String Mid(int nFirst) const;
CCom_String Left(int nCount) const;
CCom_String Right(int nCount) const;
CCom_String SpanIncluding(LPCTSTR lpszCharSet) const;
CCom_String SpanExcluding(LPCTSTR lpszCharSet) const;
// upper/lower/reverse conversion
void MakeUpper();
void MakeLower();
void MakeReverse();
// trimming whitespace (either side)
void TrimRight();
void TrimLeft();
// searching (return starting index, or -1 if not found)
// look for a single character match
int Find(TCHAR ch) const; // like "C" strchr
int ReverseFind(TCHAR ch) const;
int FindOneOf(LPCTSTR lpszCharSet) const;
// advanced manipulation
int Replace(TCHAR chOld, TCHAR chNew);
int Replace(LPCTSTR lpszOld, LPCTSTR lpszNew);
int Remove(TCHAR chRemove);
int Insert(int nIndex, TCHAR ch);
int Insert(int nIndex, LPCTSTR pstr);
int Delete(int nIndex, int nCount = 1);
// look for a specific sub-string
int Find(LPCTSTR lpszSub) const; // like "C" strstr
// simple formatting
void _cdecl Format(LPCTSTR lpszFormat, ...);
void _cdecl Format(UINT nFormatID,HINSTANCE inst, ...);
void _cdecl FormatHex (char *mem,int count);
void FormatV(LPCTSTR lpszFormat, va_list argList);
#ifndef _MAC
// formatting for localization (uses FormatMessage API)
void _cdecl FormatMessage(LPCTSTR lpszFormat, ...);
void _cdecl FormatMessage(UINT nFormatID,HINSTANCE inst, ...);
#endif
// Windows support
bool LoadString(UINT nID,HINSTANCE inst=NULL); // load from string resource
// 255 chars max
#ifndef _UNICODE
// ANSI <-> OEM support (convert string in place)
void AnsiToOem();
void OemToAnsi();
#endif
#ifndef _AFX_NO_BSTR_SUPPORT
// OLE BSTR support (use for OLE automation)
BSTR AllocSysString() const;
BSTR SetSysString(BSTR* pbstr) const;
#endif
// Access to string implementation buffer as "C" character array
LPTSTR GetBuffer(int nMinBufLength);
void ReleaseBuffer(int nNewLength = -1);
LPTSTR GetBufferSetLength(int nNewLength);
void FreeExtra();
// Use LockBuffer/UnlockBuffer to turn refcounting off
LPTSTR LockBuffer();
void UnlockBuffer();
// Implementation
public:
~CCom_String();
int GetAllocLength() const;
protected:
LPTSTR m_pchData; // pointer to ref counted string data
// implementation helpers
CCom_StringData* GetData() const;
void Init();
void AllocCopy(CCom_String& dest, int nCopyLen, int nCopyIndex, int nExtraLen) const;
void AllocBuffer(int nLen);
void AssignCopy(int nSrcLen, LPCTSTR lpszSrcData);
void ConcatCopy(int nSrc1Len, LPCTSTR lpszSrc1Data, int nSrc2Len, LPCTSTR lpszSrc2Data);
void ConcatInPlace(int nSrcLen, LPCTSTR lpszSrcData);
void CopyBeforeWrite();
void AllocBeforeWrite(int nLen);
void Release();
static void PASCAL Release(CCom_StringData* pData);
static int PASCAL SafeStrlen(LPCTSTR lpsz);
};
// Compare helpers
bool operator==(const CCom_String& s1, const CCom_String& s2);
bool operator==(const CCom_String& s1, LPCTSTR s2);
bool operator==(LPCTSTR s1, const CCom_String& s2);
bool operator!=(const CCom_String& s1, const CCom_String& s2);
bool operator!=(const CCom_String& s1, LPCTSTR s2);
bool operator!=(LPCTSTR s1, const CCom_String& s2);
bool operator<(const CCom_String& s1, const CCom_String& s2);
bool operator<(const CCom_String& s1, LPCTSTR s2);
bool operator<(LPCTSTR s1, const CCom_String& s2);
bool operator>(const CCom_String& s1, const CCom_String& s2);
bool operator>(const CCom_String& s1, LPCTSTR s2);
bool operator>(LPCTSTR s1, const CCom_String& s2);
bool operator<=(const CCom_String& s1, const CCom_String& s2);
bool operator<=(const CCom_String& s1, LPCTSTR s2);
bool operator<=(LPCTSTR s1, const CCom_String& s2);
bool operator>=(const CCom_String& s1, const CCom_String& s2);
bool operator>=(const CCom_String& s1, LPCTSTR s2);
bool operator>=(LPCTSTR s1, const CCom_String& s2);
// conversion helpers
int _cdecl _wcstombsz(char* mbstr, const wchar_t* wcstr, size_t count);
int _cdecl _mbstowcsz(wchar_t* wcstr, const char* mbstr, size_t count);
// Globals
extern TCHAR comline_afxChNil;
const CCom_String& comline_AfxGetEmptyString();
#define comline_afxEmptyString comline_AfxGetEmptyString()
// CCom_String
inline CCom_StringData* CCom_String::GetData() const
{ assert(m_pchData != NULL); return ((CCom_StringData*)m_pchData)-1; }
inline void CCom_String::Init()
{ m_pchData = comline_afxEmptyString.m_pchData; }
inline CCom_String::CCom_String(const unsigned char* lpsz)
{ Init(); *this = (LPCSTR)lpsz; }
inline const CCom_String& CCom_String::operator=(const unsigned char* lpsz)
{ *this = (LPCSTR)lpsz; return *this; }
#ifdef _UNICODE
inline const CCom_String& CCom_String::operator+=(char ch)
{ *this += (TCHAR)ch; return *this; }
inline const CCom_String& CCom_String::operator=(char ch)
{ *this = (TCHAR)ch; return *this; }
inline CCom_String operator+(const CCom_String& string, char ch)
{ return string + (TCHAR)ch; }
inline CCom_String operator+(char ch, const CCom_String& string)
{ return (TCHAR)ch + string; }
#endif
inline int CCom_String::GetLength() const
{ return GetData()->nDataLength; }
inline int CCom_String::GetAllocLength() const
{ return GetData()->nAllocLength; }
inline bool CCom_String::IsEmpty() const
{ return GetData()->nDataLength == 0; }
inline CCom_String::operator LPCTSTR() const
{ return m_pchData; }
inline int PASCAL CCom_String::SafeStrlen(LPCTSTR lpsz)
{ return (lpsz == NULL) ? 0 : lstrlen(lpsz); }
// CCom_String support (windows specific)
inline int CCom_String::Compare(LPCTSTR lpsz) const
{ return _tcscmp(m_pchData, lpsz); } // MBCS/Unicode aware
inline int CCom_String::CompareNoCase(LPCTSTR lpsz) const
{ return _tcsicmp(m_pchData, lpsz); } // MBCS/Unicode aware
// CCom_String::Collate is often slower than Compare but is MBSC/Unicode
// aware as well as locale-sensitive with respect to sort order.
inline int CCom_String::Collate(LPCTSTR lpsz) const
{ return _tcscoll(m_pchData, lpsz); } // locale sensitive
inline TCHAR CCom_String::GetAt(int nIndex) const
{
assert(nIndex >= 0);
assert(nIndex < GetData()->nDataLength);
return m_pchData[nIndex];
}
inline TCHAR CCom_String::operator[](int nIndex) const
{
// same as GetAt
assert(nIndex >= 0);
assert(nIndex < GetData()->nDataLength);
return m_pchData[nIndex];
}
inline bool operator==(const CCom_String& s1, const CCom_String& s2)
{ return s1.Compare(s2) == 0; }
inline bool operator==(const CCom_String& s1, LPCTSTR s2)
{ return s1.Compare(s2) == 0; }
inline bool operator==(LPCTSTR s1, const CCom_String& s2)
{ return s2.Compare(s1) == 0; }
inline bool operator!=(const CCom_String& s1, const CCom_String& s2)
{ return s1.Compare(s2) != 0; }
inline bool operator!=(const CCom_String& s1, LPCTSTR s2)
{ return s1.Compare(s2) != 0; }
inline bool operator!=(LPCTSTR s1, const CCom_String& s2)
{ return s2.Compare(s1) != 0; }
inline bool operator<(const CCom_String& s1, const CCom_String& s2)
{ return s1.Compare(s2) < 0; }
inline bool operator<(const CCom_String& s1, LPCTSTR s2)
{ return s1.Compare(s2) < 0; }
inline bool operator<(LPCTSTR s1, const CCom_String& s2)
{ return s2.Compare(s1) > 0; }
inline bool operator>(const CCom_String& s1, const CCom_String& s2)
{ return s1.Compare(s2) > 0; }
inline bool operator>(const CCom_String& s1, LPCTSTR s2)
{ return s1.Compare(s2) > 0; }
inline bool operator>(LPCTSTR s1, const CCom_String& s2)
{ return s2.Compare(s1) < 0; }
inline bool operator<=(const CCom_String& s1, const CCom_String& s2)
{ return s1.Compare(s2) <= 0; }
inline bool operator<=(const CCom_String& s1, LPCTSTR s2)
{ return s1.Compare(s2) <= 0; }
inline bool operator<=(LPCTSTR s1, const CCom_String& s2)
{ return s2.Compare(s1) >= 0; }
inline bool operator>=(const CCom_String& s1, const CCom_String& s2)
{ return s1.Compare(s2) >= 0; }
inline bool operator>=(const CCom_String& s1, LPCTSTR s2)
{ return s1.Compare(s2) >= 0; }
inline bool operator>=(LPCTSTR s1, const CCom_String& s2)
{ return s2.Compare(s1) <= 0; }
#endif
@@ -0,0 +1,67 @@
#ifndef __CRITICALHPP__
#define __CRITICALHPP__
#include <windows.h>
#include <assert.h>
// macro to help with using the SMART_CRITICAL class
// you can just say CRITICAL_CONTROL(ThreadSafe), this will
// place the current scope in a critical section
#define CRITICAL_CONTROL(x) SMART_CRITICAL crit##x (x)
#define CRITICAL_CONTROL_2(x,y) SMART_CRITICAL crit##x (y)
// class to handle controling critical sections
// you would use this class to create thread safe and exception safe code
// since the LeaveCriticalSection is in the destructor it will automatically
// be called when the class goes out of scope, for instance when the stack
// is unwinding from an exception
class SMART_CRITICAL {
private:
CRITICAL_SECTION *m_Crit;
public:
SMART_CRITICAL (CRITICAL_SECTION& crit)
{
m_Crit = &crit;
EnterCriticalSection (m_Crit);
}
~SMART_CRITICAL (void)
{
LeaveCriticalSection (m_Crit);
}
};
// class to handle global critical sections
// the constructor will automatically init the critical section and
// the destructor will automatically delete the critical section.
// This makes it useful for globals for instance, the class will automatically
// create and destroy the critical section for you.
// Note: for various reason I made it bad to create this class dynamically
class ROOT_CRITICAL : public CRITICAL_SECTION {
public:
ROOT_CRITICAL (void)
{
InitializeCriticalSection (this);
}
ROOT_CRITICAL( const ROOT_CRITICAL&)
{
InitializeCriticalSection( this );
}
~ROOT_CRITICAL (void)
{
DeleteCriticalSection (this);
}
void Lock(void)
{
EnterCriticalSection(this);
}
void Unlock(void)
{
LeaveCriticalSection(this);
}
void *operator new (size_t)
{
assert (false);
return NULL;
}
};
#endif
@@ -0,0 +1,383 @@
#include "comline.hpp"
//#include <exception>
#include <stdio.h>
#include "comline.h"
static void* __cdecl operator new (unsigned int size)
{
return malloc (size);
}
static void __cdecl operator delete (void *buffer)
{
free (buffer);
}
using namespace NCOMLINE;
CCommandLineServer *NCOMLINE::n_CurServer = NULL;
void ExecuteLine(const unsigned char * pszString)
{
if (n_CurServer)
n_CurServer->ExecuteLine ((const char *) pszString);
}
int NumOutputLines(void)
{
if (n_CurServer)
return n_CurServer->NumOutputLines ();
return 0;
}
void GetOutputLine(int size,unsigned char * pszString)
{
if (n_CurServer)
n_CurServer->GetOutputLine (size,pszString);
}
void Shutdown(void)
{
#ifdef LAB_ONLY
RPC_STATUS status;
status = RpcMgmtStopServerListening(NULL);
if (!status)
{
status = RpcServerUnregisterIf(NULL, NULL, FALSE);
}
#endif
}
DWORD WINAPI NCOMLINE::ServerThreadProc (void *p1)
{
#if LAB_ONLY
CCommandLineServer *data;
data = static_cast<CCommandLineServer *> (p1);
WaitForSingleObject (data->m_Semaphore,INFINITE);
ReleaseSemaphore (data->m_ExitSemaphore,1,NULL);
ReleaseSemaphore (data->m_Semaphore,1,NULL);
RPC_STATUS status;
unsigned char * pszProtocolSequence1 = (unsigned char *) "ncacn_ip_tcp";
unsigned char * pszEndpoint1 = (unsigned char *) "1404";
unsigned char * pszProtocolSequence2 = (unsigned char *) "ncalrpc";
unsigned char * pszEndpoint2 = (unsigned char *) "ComLine";
unsigned char * pszSecurity = (unsigned char *) NULL;
unsigned int cMinCalls = 1;
unsigned int cMaxCalls = 20;
unsigned int fDontWait = FALSE;
// status = RpcServerUseAllProtseqs (cMaxCalls,pszSecurity);
status = RpcServerUseProtseqEp(pszProtocolSequence1,cMaxCalls,pszEndpoint1,pszSecurity); // Security descriptor
if (status)
return (status);
status = RpcServerUseProtseqEp(pszProtocolSequence2,cMaxCalls,pszEndpoint2,pszSecurity); // Security descriptor
if (status)
return (status);
RPC_BINDING_VECTOR *inq;
status = RpcServerInqBindings (&inq);
status = RpcServerRegisterIf(ComLine_ServerIfHandle, // interface to register
NULL, // MgrTypeUuid
NULL); // MgrEpv; null means use default
if (status)
return (status);
status = RpcServerListen(cMinCalls,cMaxCalls,fDontWait);
if (status)
return status;
WaitForSingleObject (data->m_ExitSemaphore,INFINITE);
#endif
return 0;
}
void CCommandLineServer::PushLine (const LineData& data)
{
CRITICAL_CONTROL (m_Critical);
if (!m_Inited)
return;
if (m_NumLines == m_SizeLines)
{
int i;
LineData *temp;
temp = new LineData[m_SizeLines+50];
for (i=0;i<m_NumLines;i++)
{
temp[i] = m_Lines[i];
}
delete[] m_Lines;
m_Lines = temp;
m_SizeLines+=50;
}
m_Lines[m_NumLines] = data;
m_NumLines++;
}
void CCommandLineServer::RemoveLine (void)
{
int i;
CRITICAL_CONTROL (m_Critical);
if (!m_Inited)
return;
assert (m_NumLines);
m_NumLines--;
for (i=0;i<m_NumLines;i++)
{
m_Lines[i] = m_Lines[i+1];
}
}
void CCommandLineServer::PushCommand (const CommandMap& data)
{
CRITICAL_CONTROL (m_Critical);
if (!m_Inited)
return;
if (m_NumLines == m_SizeLines)
{
int i;
CommandMap *temp;
temp = new CommandMap[m_SizeCommands+50];
for (i=0;i<m_NumCommands;i++)
{
temp[i] = m_Commands[i];
}
delete[] m_Commands;
m_Commands = temp;
m_SizeCommands+=50;
}
m_Commands[m_NumCommands] = data;
m_NumCommands++;
}
CCommandLineServer::CCommandLineServer (void)
{
m_Inited = false;
m_Lines = NULL;
m_NumLines = 0;
m_SizeLines = 0;
m_Commands = NULL;
m_NumCommands = 0;
m_SizeCommands = 0;
m_Semaphore = NULL;
m_ExitSemaphore = NULL;
m_Thread = NULL;
hMappedFile=NULL;
#if LAB_ONLY
hMappedFile=CreateFileMapping( (HANDLE)0xffffffff, //-1 hFile flag
NULL, // no sharing allowed
PAGE_READONLY|SEC_RESERVE, // no writing or physical space allocated
0, // high-byte size
4, // low byte size
"AHF_COMLINE_FILE"); // use class string as file name
if (hMappedFile!=NULL && GetLastError() == ERROR_ALREADY_EXISTS)
{
//another T2 is running, it just hasn't created it's window yet
CloseHandle(hMappedFile);
hMappedFile=NULL;
return;
}
m_Lines = new LineData[50];
m_NumLines = 0;
m_SizeLines = 50;
PushLine (LineData ("Command Line server started",LINE_OUTPUT));
m_Commands = new CommandMap[50];
m_NumCommands = 0;
m_SizeCommands = 50;
m_Semaphore = CreateSemaphore (NULL,0,1,NULL);
if (!m_Semaphore)
assert (false);
m_ExitSemaphore = CreateSemaphore (NULL,0,1,NULL);
if (!m_ExitSemaphore)
assert (false);
m_Thread = CreateThread (NULL,0,NCOMLINE::ServerThreadProc,(void *) this,0,&m_ThreadID);
if (!m_Thread)
assert (false);
ReleaseSemaphore (m_Semaphore,1,NULL);
WaitForSingleObject (m_ExitSemaphore,INFINITE);
WaitForSingleObject (m_Semaphore,INFINITE);
n_CurServer = this;
m_Inited = true;
#endif
}
CCommandLineServer::~CCommandLineServer (void)
{
if (!m_Inited)
return;
#ifdef LAB_ONLY
RPC_STATUS status;
status = RpcMgmtStopServerListening(NULL);
if (!status)
{
status = RpcServerUnregisterIf(NULL, NULL, FALSE);
}
#endif
n_CurServer = NULL;
ReleaseSemaphore (m_ExitSemaphore,1,NULL);
WaitForSingleObject (m_Thread,INFINITE);
CloseHandle (m_ExitSemaphore);
CloseHandle (m_Semaphore);
CloseHandle (m_Thread);
if (hMappedFile)
CloseHandle (hMappedFile);
hMappedFile = NULL;
delete[] m_Lines;
delete[] m_Commands;
m_Inited = false;
}
void CCommandLineServer::PushLine (const char *line)
{
CRITICAL_CONTROL (m_Critical);
if (!m_Inited)
return;
LineData data (line,LINE_OUTPUT);
PushLine (data);
}
void CCommandLineServer::ExecuteLine (const char *line)
{
CRITICAL_CONTROL (m_Critical);
int iter;
LineData data (line,LINE_COMMAND);
CCom_String name (line);
if (!m_Inited)
return;
ParseLine (data);
if (data.m_ComBreak != name.GetLength ())
{
name.SetAt (data.m_ComBreak,0);
}
for (iter = 0;iter<m_NumCommands;iter++)
{
if (m_Commands[iter].m_Command == name)
break;
}
if (iter != m_NumCommands)
{
if (!m_Commands[iter].m_Function (this,data))
PushLine (LineData ("Function failed",LINE_OUTPUT));
}
else
{
PushLine (LineData ("Function not found",LINE_OUTPUT));
}
}
void CCommandLineServer::ParseLine (LineData& data)
{
char *buf;
int i,size;
bool ignore;
CRITICAL_CONTROL (m_Critical);
ignore = false;
data.m_Data.TrimLeft ();
data.m_ComBreak = -1;
size = data.m_Data.GetLength ();
buf = data.m_Data.GetBuffer (0);
for (i=0;i<size;i++,buf++)
{
if ((*buf == ' ') && !ignore)
{
data.m_ArgBreak[data.m_NumArgs] = i;
data.m_NumArgs++;
}
else if (*buf == '\"')
{
ignore = !ignore;
}
}
data.m_Data.ReleaseBuffer ();
data.m_ArgBreak[data.m_NumArgs] = data.m_Data.GetLength ();
data.m_NumArgs++;
data.m_ComBreak = data.m_ArgBreak[0];
}
int CCommandLineServer::NumOutputLines(void)
{
return m_NumLines;
}
void CCommandLineServer::GetOutputLine(int size,unsigned char * pszString)
{
CRITICAL_CONTROL (m_Critical);
LineData *iter;
iter = m_Lines;
if (m_NumLines)
{
const char *buffer = (LPCTSTR) iter->m_Data;
strncpy ((char *) pszString,buffer,size-1);
pszString[size-1] = 0;
RemoveLine ();
}
else
pszString[0] = 0;
}
bool CCommandLineServer::AddCommand (NCOMLINE::ComFunc func,const CCom_String& name)
{
CRITICAL_CONTROL (m_Critical);
int iter;
if (!m_Inited)
return false;
for (iter = 0;iter<m_NumCommands;iter++)
{
if (m_Commands[iter].m_Command == name)
break;
}
if (iter != m_NumCommands)
m_Commands[iter].m_Function = func;
else
PushCommand (CommandMap (name,func));
return true;
}
bool CCommandLineServer::RemoveCommand (const CCom_String& name)
{
CRITICAL_CONTROL (m_Critical);
int iter;
int i;
if (!m_Inited)
return false;
for (iter = 0;iter<m_NumCommands;iter++)
{
if (m_Commands[iter].m_Command == name)
break;
}
if (iter == m_NumCommands)
return false;
m_NumCommands--;
for (i=iter;i<m_NumCommands;i++)
{
m_Commands[i] = m_Commands[i+1];
}
return true;
}
@@ -0,0 +1,211 @@
# Microsoft Developer Studio Project File - Name="server" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=server - Win32 icecap
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "server.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "server.mak" CFG="server - Win32 icecap"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "server - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "server - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "server - Win32 Armor" (based on "Win32 (x86) Static Library")
!MESSAGE "server - Win32 Profile" (based on "Win32 (x86) Static Library")
!MESSAGE "server - Win32 icecap" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "server - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../rel.bin"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /G6 /Zp4 /MD /W3 /Zi /Ox /Ot /Oa /Og /Oi /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /D "NDEBUG" /D "RELEASE" /D "USE_PROTOTYPES" /D "STRICT" /D "_WINDOWS" /D "WIN32" /D "COMSERVER" /YX /FD /c
# SUBTRACT CPP /WX /Fr
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "server - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "server___Win32_Debug"
# PROP BASE Intermediate_Dir "server___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../dbg.bin"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /G6 /Zp4 /MDd /W3 /GR /Zi /Od /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /D "LAB_ONLY" /D "USE_PROTOTYPES" /D "STRICT" /D "_ARMOR" /D "_DEBUG" /D "_WINDOWS" /D "WIN32" /D "COMSERVER" /YX /FD /GZ /c
# SUBTRACT CPP /WX /Fr
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "server - Win32 Armor"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "server___Win32_Armor"
# PROP BASE Intermediate_Dir "server___Win32_Armor"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../arm.bin"
# PROP Intermediate_Dir "Armor"
# PROP Target_Dir ""
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "COMSERVER" /D "WIN32" /YX /FD /GZ /c
# ADD CPP /nologo /G6 /Zp4 /MD /W3 /GR /Zi /Ox /Ot /Oa /Og /Oi /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /D "LAB_ONLY" /D "NDEBUG" /D "_ARMOR" /D "USE_PROTOTYPES" /D "STRICT" /D "_WINDOWS" /D "WIN32" /D "COMSERVER" /YX /FD /c
# SUBTRACT CPP /WX /Fr
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "server - Win32 Profile"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "server___Win32_Profile"
# PROP BASE Intermediate_Dir "server___Win32_Profile"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../pro.bin"
# PROP Intermediate_Dir "Profile"
# PROP Target_Dir ""
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "COMSERVER" /D "WIN32" /YX /FD /GZ /c
# ADD CPP /nologo /G6 /Zp4 /MD /W3 /Zi /Ox /Ot /Oa /Og /Oi /Gy /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /D "LAB_ONLY" /D "NDEBUG" /D "USE_PROTOTYPES" /D "STRICT" /D "_WINDOWS" /D "WIN32" /D "COMSERVER" /YX /FD /c
# SUBTRACT CPP /WX /Fr
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "server - Win32 icecap"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "server___Win32_icecap"
# PROP BASE Intermediate_Dir "server___Win32_icecap"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../ice.bin"
# PROP Intermediate_Dir "icecap"
# PROP Target_Dir ""
MTL=midl.exe
# ADD BASE CPP /nologo /G6 /Zp4 /MD /W3 /WX /Zi /Ox /Ot /Oa /Og /Oi /Gy /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /D "LAB_ONLY" /D "NDEBUG" /D "USE_PROTOTYPES" /D "STRICT" /D "_WINDOWS" /D "WIN32" /D "COMSERVER" /YX /FD /c
# ADD CPP /nologo /G6 /Zp4 /MD /W3 /Zi /Ot /Oa /Oi /Gy /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /D "LAB_ONLY" /D "USE_PROTOTYPES" /D "STRICT" /D "_WINDOWS" /D "COMSERVER" /D "NDEBUG" /D "WIN32" /D "_ICECAP" /YX /FD /c
# SUBTRACT CPP /WX /Og /Fr
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
# Name "server - Win32 Release"
# Name "server - Win32 Debug"
# Name "server - Win32 Armor"
# Name "server - Win32 Profile"
# Name "server - Win32 icecap"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\comline.cpp
# End Source File
# Begin Source File
SOURCE=.\comline.idl
# End Source File
# Begin Source File
SOURCE=.\comline_s.c
# End Source File
# Begin Source File
SOURCE=.\comutil.cpp
# End Source File
# Begin Source File
SOURCE=.\server.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\comline.h
# End Source File
# Begin Source File
SOURCE=.\comline.hpp
# End Source File
# Begin Source File
SOURCE=.\comutil.hpp
# End Source File
# Begin Source File
SOURCE=.\critical.hpp
# End Source File
# End Group
# End Target
# End Project