245 lines
7.2 KiB
C
245 lines
7.2 KiB
C
|
#ifndef h_nt
|
||
|
#define h_nt
|
||
|
/******************************************************************************
|
||
|
*
|
||
|
* NT specific defines
|
||
|
*
|
||
|
* Module %M% Version %I% Date %H%
|
||
|
*
|
||
|
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
|
||
|
* This is unpublished proprietary source code of Ardent Software Inc.
|
||
|
* The copyright notice above does not evidence any actual or intended
|
||
|
* publication of such source code.
|
||
|
*
|
||
|
*******************************************************************************
|
||
|
*
|
||
|
* Maintenence log - insert most recent change descriptions at top
|
||
|
*
|
||
|
* Date.... GTAR# WHO Description.........................................
|
||
|
* 10/19/98 23768 DJD Added NT_TTY_FIXFILE.
|
||
|
* 10/14/98 23801 SAP Change copyrights.
|
||
|
* 10/02/98 23765 CSM more header files for licensing
|
||
|
* 06/18/97 20606 DPB Added NT_TTY_UVDR #define
|
||
|
* 05/12/97 20592 AGM VC50 change - use WIN32_LEAN_AND_MEAN
|
||
|
* 09/26/96 19334 AGM Remove pragma - don't hide errors!
|
||
|
* 08/02/96 19159 JC Changed WSTAT to be a structure.
|
||
|
* 07/04/96 18423 JJV Removed WINNT IGNORE_FOR_NOW definition.
|
||
|
* 06/24/96 18416 LAG Added NT_TTY_UVSRV
|
||
|
* 06/19/96 18650 GMM Added NT_TTY_DEADLOCK
|
||
|
* 05/22/96 18747 AGM Add UVFIN_EXCEPTION_CODE
|
||
|
* 05/20/96 18451 DJD Added NT_TTY_UVCS for uvcs server.
|
||
|
* 04/22/96 17804 GMM Added nt_ttyname_type extern. Removed TTY_CHILD def.
|
||
|
* 04/09/96 18246 GMM Added extern of UVcreateprocess
|
||
|
* 02/20/96 18053 AGM Remove unused definitions
|
||
|
* 02/09/96 17804 GMM Changed TTY types into bit fields.
|
||
|
* 12/13/95 17676 AGM Added TTY type tokens and related declarations
|
||
|
* 20/10/95 17533 JJV Added UNIVERSE_PARENT_PROCESS for NT.
|
||
|
* 08/17/95 17197 AGM Initial changes for Windows 95
|
||
|
* 08/01/95 17053 SJM Added uv_wait_for_object_*() externs
|
||
|
* 06/26/95 16770 SJM Moved isatty into a seperate module
|
||
|
* 06/07/95 15077 GMM Added more service request keys
|
||
|
* 05/26/95 15077 GMM Added UV service request keys
|
||
|
* 04/12/95 16313 SJM Added isatty define
|
||
|
* 04/12/95 16313 SJM Added signal defs
|
||
|
* 04/10/95 16268 AGM Moved registry data into uvreg.h
|
||
|
* 04/05/95 16230 SJM Added pid_t
|
||
|
* 03/23/95 16141 SJM Added pid, pgrp and tty defs.
|
||
|
* 03/20/95 16141 SJM Added NT RPC defs
|
||
|
* 03/06/95 16069 GMM Added definition of R_OK (for access() call)
|
||
|
* 02/15/95 15853 SJM Move uid stuff to uid.h
|
||
|
* 01/19/95 15814 GMM Added definition of WSTAT
|
||
|
* 12/02/94 15166 GMM Added more definitions for initial NT build
|
||
|
* 10/10/94 15078 SJM Module Created
|
||
|
*
|
||
|
******************************************************************************/
|
||
|
|
||
|
/* include the standard windows include files */
|
||
|
|
||
|
#define WIN32_LEAN_AND_MEAN
|
||
|
|
||
|
#include <windows.h>
|
||
|
#include <wincon.h>
|
||
|
#include <nb30.h>
|
||
|
#include <winsock.h>
|
||
|
#include <winspool.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <string.h>
|
||
|
#include <io.h>
|
||
|
#include "uid.h"
|
||
|
|
||
|
#undef memchr
|
||
|
|
||
|
/****************************************************************************/
|
||
|
|
||
|
typedef signed int pid_t;
|
||
|
|
||
|
/****************************************************************************/
|
||
|
|
||
|
/* redefine isatty() to be our own function, because we need to
|
||
|
fudge its behaviour slightly */
|
||
|
|
||
|
#undef isatty
|
||
|
#define isatty(x) uvnt_isatty(x)
|
||
|
|
||
|
extern int uvnt_isatty(int);
|
||
|
extern void set_ttytype(int);
|
||
|
extern int get_ttytype(void);
|
||
|
extern char *nt_ttyname(int, pid_t);
|
||
|
extern char *nt_ttyname_type(int);
|
||
|
|
||
|
/* Types of controlling terminal that can be used by uniVerse */
|
||
|
|
||
|
#define NT_TTY_UNKNOWN 0x00
|
||
|
#define NT_TTY_PHANTOM 0x01
|
||
|
#define NT_TTY_CONSOLE 0x02
|
||
|
#define NT_TTY_TELNET 0x04
|
||
|
#define NT_TTY_DEADLOCK 0x08
|
||
|
#define NT_TTY_UVRPC 0x10
|
||
|
#define NT_TTY_UVNET 0x20
|
||
|
#define NT_TTY_UVCS 0x40
|
||
|
#define NT_TTY_UVSRV 0x80
|
||
|
#define NT_TTY_UVDR 0x100
|
||
|
#define NT_TTY_FIXFILE 0x200
|
||
|
|
||
|
/****************************************************************************/
|
||
|
|
||
|
/* Names of DLLs containing various things */
|
||
|
|
||
|
/*
|
||
|
* DLL containing shared memory library.
|
||
|
*/
|
||
|
|
||
|
#define UVUTIL_DLL "uvutil.dll"
|
||
|
|
||
|
/*
|
||
|
* DLL containing the event logging resources
|
||
|
*/
|
||
|
|
||
|
#define UVLOG_DLL "uvutil.dll"
|
||
|
|
||
|
/****************************************************************************/
|
||
|
|
||
|
/* signal and interrupt handling */
|
||
|
|
||
|
extern HANDLE signal_kickstart;
|
||
|
|
||
|
extern DWORD uv_wait_for_object_infinite(HANDLE);
|
||
|
extern DWORD uv_wait_for_object_alarmed(HANDLE);
|
||
|
|
||
|
|
||
|
/****************************************************************************/
|
||
|
|
||
|
/* pid and pgrps */
|
||
|
|
||
|
extern pid_t getppid();
|
||
|
extern void nt_setpgrp();
|
||
|
extern void nt_resetpgrp();
|
||
|
extern pid_t getpgrp();
|
||
|
|
||
|
/* environment variable names, these should really be unguessable */
|
||
|
|
||
|
#define UVNT_PGRP_ENVVAR "UNIVERSE_PROCESS_GROUP"
|
||
|
#define UVNT_TERMTYPE_ENVVAR "UNIVERSE_CONTROLLING_TERM"
|
||
|
#define UVNT_PARENT_ENVVAR "UNIVERSE_PARENT_PROCESS"
|
||
|
|
||
|
/****************************************************************************/
|
||
|
|
||
|
/* declare our process creation routine */
|
||
|
|
||
|
extern BOOL UVcreateprocess(LPCTSTR exec_name, LPTSTR cmd_line,
|
||
|
LPSECURITY_ATTRIBUTES proc_attribs,
|
||
|
LPSECURITY_ATTRIBUTES thread_attribs, BOOL inherit_handles,
|
||
|
DWORD creation_flags, LPVOID proc_environ, LPCTSTR current_dir,
|
||
|
LPSTARTUPINFO startup_info, LPPROCESS_INFORMATION proc_info);
|
||
|
|
||
|
/****************************************************************************/
|
||
|
|
||
|
/*
|
||
|
* define our keys for talking to the universe service
|
||
|
*/
|
||
|
#define UV_GET_CAT_SHM 1
|
||
|
#define UV_FREE_CAT_SHM 2
|
||
|
#define UV_GET_NLS_SHM 3
|
||
|
#define UV_FREE_NLS_SHM 4
|
||
|
|
||
|
/*
|
||
|
* define the NT version of WSTAT
|
||
|
*/
|
||
|
|
||
|
struct wstat_struct
|
||
|
{
|
||
|
short error; /* Error code from the fork/wait */
|
||
|
int exit_code; /* Value returned from the executable */
|
||
|
};
|
||
|
|
||
|
#define WSTAT struct wstat_struct
|
||
|
|
||
|
/*
|
||
|
* define an NT version of R_OK, for use in the access() call
|
||
|
*/
|
||
|
#define R_OK 4
|
||
|
|
||
|
/*
|
||
|
* define S_IFIFO from the underscored version
|
||
|
*/
|
||
|
#define S_IFIFO _S_IFIFO
|
||
|
|
||
|
/*
|
||
|
* O_SYNC is not avilable on NT
|
||
|
*/
|
||
|
#define O_SYNC 0
|
||
|
|
||
|
/*
|
||
|
* types undefined under NT
|
||
|
*/
|
||
|
|
||
|
typedef int key_t;
|
||
|
typedef unsigned short mode_t;
|
||
|
|
||
|
|
||
|
/*
|
||
|
* and a utsname structure
|
||
|
*/
|
||
|
struct utsname {
|
||
|
char sysname[9];
|
||
|
char nodename[MAX_COMPUTERNAME_LENGTH + 1];
|
||
|
char release[9];
|
||
|
char version[9];
|
||
|
char machine[9];
|
||
|
};
|
||
|
|
||
|
/*
|
||
|
* The following token defines the exception that gets raised by fin() when asked
|
||
|
* to terminate by generating an exception. The Win32 documentation says that users
|
||
|
* can raise their own exceptions but gives no indication as to the range of values
|
||
|
* that should be used for such. The value specified here is chosen so as not to
|
||
|
* conflict with any of the documented standard exceptions.... Note that whatever
|
||
|
* value is chosen bit 28 bust be clear (See RaiseException() documentation)
|
||
|
*/
|
||
|
|
||
|
#define UV_FIN_EXCEPTION_CODE 0x0ACE0ACE
|
||
|
|
||
|
|
||
|
/*****************************************************************************/
|
||
|
/*
|
||
|
/* WARNING: These defs are undef'd here because they get redefined later
|
||
|
/* by the universe source to something competely different.
|
||
|
/*
|
||
|
/* Use these macros with care !
|
||
|
/*
|
||
|
/*****************************************************************************/
|
||
|
|
||
|
#define WINNT_DELETE DELETE
|
||
|
#undef DELETE
|
||
|
#define WINNT_IN IN
|
||
|
#undef IN
|
||
|
#define WINNT_OUT OUT
|
||
|
#undef OUT
|
||
|
#define WINNT_WEOF WEOF
|
||
|
#undef WEOF
|
||
|
#define WINNT_LPTR LPTR
|
||
|
#undef LPTR
|
||
|
|
||
|
|
||
|
#endif /* end of nt.h */
|