1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
|
/*************************************************************************
*
* NWLIBS.H
*
* Prototypes
*
* Copyright (c) 1995 Microsoft Corporation
*
* $Log: N:\NT\PRIVATE\NW4\NWSCRIPT\INC\VCS\NWLIBS.H $
*
* Rev 1.1 22 Dec 1995 14:20:28 terryt
* Add Microsoft headers
*
* Rev 1.0 15 Nov 1995 18:05:36 terryt
* Initial revision.
*
* Rev 1.1 25 Aug 1995 17:03:46 terryt
* CAPTURE support
*
* Rev 1.0 15 May 1995 19:09:40 terryt
* Initial revision.
*
*************************************************************************/
/*++
Copyright (c) 1994 Micro Computer Systems, Inc.
Module Name:
nwlibs\nwlibs.h
Abstract:
NW Libs prototypes.
Author:
Shawn Walker (v-swalk) 10-10-1994
Revision History:
--*/
#ifndef _NWLIBS_H_
#define _NWLIBS_H_
/*++
*******************************************************************
NetWare defaults
*******************************************************************
--*/
#define NCP_BINDERY_OBJECT_NAME_LENGTH 48
#define NCP_SERVER_NAME_LENGTH NCP_BINDERY_OBJECT_NAME_LENGTH
#define NCP_MAX_PATH_LENGTH 255
#define NCP_VOLUME_LENGTH 256 // 16 in 3X
/*++
*******************************************************************
Defines for GetDrive Status
*******************************************************************
--*/
#define NETWARE_UNMAPPED_DRIVE 0x0000
#define NETWARE_FREE_DRIVE 0x0000
#define NETWARE_LOCAL_FREE_DRIVE 0x0800
#define NETWARE_LOCAL_DRIVE 0x1000
#define NETWARE_NETWORK_DRIVE 0x2000
#define NETWARE_LITE_DRIVE 0x4000
#define NETWARE_PNW_DRIVE 0x4000
#define NETWARE_NETWARE_DRIVE 0x8000
#define NETWARE_FORMAT_NETWARE 0
#define NETWARE_FORMAT_SERVER_VOLUME 1
#define NETWARE_FORMAT_DRIVE 2
#define NETWARE_FORMAT_UNC 3
#define NCP_JOB_DESCRIPTION_LENGTH 50
#define NCP_BANNER_TEXT_LENGTH 13
#define NCP_FORM_NAME_LENGTH 13
#define NCP_QUEUE_NAME_LENGTH 65
#define CAPTURE_FLAG_PRINT_BANNER 0x80
#define CAPTURE_FLAG_EXPAND_TABS 0x40
#define CAPTURE_FLAG_NOTIFY 0x10
#define CAPTURE_FLAG_NO_FORMFEED 0x08
#define CAPTURE_FLAG_KEEP 0x04
#define DEFAULT_PRINT_FLAGS 0xC0
#define DEFAULT_BANNER_TEXT "LPT:"
typedef struct _NETWARE_CAPTURE_FLAGS_RW {
unsigned char JobDescription[NCP_JOB_DESCRIPTION_LENGTH];
unsigned char JobControlFlags;
unsigned char TabSize;
unsigned short NumCopies;
unsigned short PrintFlags;
unsigned short MaxLines;
unsigned short MaxChars;
unsigned char FormName[NCP_FORM_NAME_LENGTH];
unsigned char Reserved1[9];
unsigned short FormType;
unsigned char BannerText[NCP_BANNER_TEXT_LENGTH];
unsigned char Reserved2;
unsigned short FlushCaptureTimeout;
unsigned char FlushCaptureOnClose;
} NETWARE_CAPTURE_FLAGS_RW, *PNETWARE_CAPTURE_FLAGS_RW, *LPNETWARE_CAPTURE_FLAGS_RW;
typedef struct _NETWARE_CAPTURE_FLAGS_RO {
unsigned short ConnectionID;
unsigned short SetupStringMaxLen;
unsigned short ResetStringMaxLen;
unsigned char LPTCaptureFlag;
unsigned char FileCaptureFlag;
unsigned char TimingOutFlag;
unsigned char InProgress;
unsigned char PrintQueueFlag;
unsigned char PrintJobValid;
unsigned char QueueName[NCP_QUEUE_NAME_LENGTH];
unsigned char ServerName[NCP_SERVER_NAME_LENGTH];
} NETWARE_CAPTURE_FLAGS_RO, *PNETWARE_CAPTURE_FLAGS_RO, *LPNETWARE_CAPTURE_FLAGS_RO;
#define NETWARE_CAPTURE_FLAGS_RO_SIZE sizeof(NETWARE_CAPTURE_FLAGS_RO)
#define NETWARE_CAPTURE_FLAGS_RW_SIZE sizeof(NETWARE_CAPTURE_FLAGS_RW)
#define PS_FORM_NAME_SIZE 12
#define PS_BANNER_NAME_SIZE 12
#define PS_BANNER_FILE_SIZE 12
#define PS_DEVICE_NAME_SIZE 32
#define PS_MODE_NAME_SIZE 32
#define PS_BIND_NAME_SIZE NCP_BINDERY_OBJECT_NAME_LENGTH
#define PS_MAX_NAME_SIZE 514
/** Flags for the PS_JOB_REC structure PrintJobFlag field **/
#define PS_JOB_EXPAND_TABS 0x00000001 /* File type:0=Stream 1=Tab */
#define PS_JOB_NO_FORMFEED 0x00000002 /* Formfeed tail:0=Yes 1=No */
#define PS_JOB_NOTIFY 0x00000004 /* Notify:0=No 1=Yes */
#define PS_JOB_PRINT_BANNER 0x00000008 /* Banner:0=No 1=Yes */
#define PS_JOB_AUTO_END 0x00000010 /* Auto endcap:0=No 1=Yes */
#define PS_JOB_TIMEOUT 0x00000020 /* Enable T.O.:0=No 1=Yes */
#define PS_JOB_ENV_DS 0x00000040 /* Use D.S. Environment */
#define PS_JOB_ENV_MASK 0x000001C0 /* Bindery vs. D.S. Mask */
#define PS_JOB_DS_PRINTER 0x00000200 /* D.S. Printer not Queue */
#define PS_JOB_PRINTER_MASK 0x00000E00 /* D.S. Printer vs. Queue */
/** Default Flags **/
#define PS_JOB_DEFAULT (NWPS_JOB_PRINT_BANNER | NWPS_JOB_AUTO_END)
#define PS_JOB_DEFAULT_COPIES 1 /* Default Number of Copies */
#define PS_JOB_DEFAULT_TAB 8 /* Default Tab Expansion */
typedef struct _PS_JOB_RECORD {
DWORD PrintJobFlag;
SHORT Copies;
SHORT TimeOutCount;
UCHAR TabSize;
UCHAR LocalPrinter;
CHAR FormName[PS_FORM_NAME_SIZE + 2];
CHAR Name[PS_BANNER_NAME_SIZE + 2];
CHAR BannerName[PS_BANNER_FILE_SIZE + 2];
CHAR Device[PS_DEVICE_NAME_SIZE + 2];
CHAR Mode[PS_MODE_NAME_SIZE + 2];
union {
struct {
/** Pad structures on even boundries **/
CHAR FileServer[PS_BIND_NAME_SIZE + 2];
CHAR PrintQueue[PS_BIND_NAME_SIZE + 2];
CHAR PrintServer[PS_BIND_NAME_SIZE + 2];
} NonDS;
CHAR DSObjectName[PS_MAX_NAME_SIZE];
} u;
UCHAR Reserved[392];
} PS_JOB_RECORD, *PPS_JOB_RECORD;
#define PS_JOB_RECORD_SIZE sizeof(PS_JOB_RECORD)
/*++
*******************************************************************
FUCNTION PROTOTYPES
*******************************************************************
--*/
/** ATTACH.C **/
unsigned int
AttachToFileServer(
unsigned char *pServerName,
unsigned int *pNewConnectionId
);
unsigned int
DetachFromFileServer(
unsigned int ConnectionId
);
/** NCP.C **/
unsigned int
GetBinderyObjectID(
unsigned int ConnectionHandle,
char *pObjectName,
unsigned short ObjectType,
unsigned long *pObjectId
);
/** CONNECT.C **/
unsigned int
GetDefaultConnectionID(
unsigned int *pConnectionHandle
);
unsigned int
GetConnectionHandle(
unsigned char *pServerName,
unsigned int *pConnectionHandle
);
unsigned int
GetConnectionNumber(
unsigned int ConnectionHandle,
unsigned int *pConnectionNumber
);
unsigned int
GetFileServerName(
unsigned int ConnectionHandle,
char *pServerName
);
unsigned int
GetInternetAddress(
unsigned int ConnectionHandle,
unsigned int ConnectionNumber,
unsigned char *pInternetAddress
);
/** DRIVE.C **/
unsigned int
GetDriveStatus(
unsigned short DriveNumber,
unsigned short PathFormat,
unsigned short *pStatus,
unsigned int *pConnectionHandle,
unsigned char *pRootPath,
unsigned char *pRelativePath,
unsigned char *pFullPath
);
unsigned int
GetFirstDrive(
unsigned short *pFirstDrive
);
unsigned int
ParsePath(
unsigned char *pPath,
unsigned char *pServerName, //OPTIONAL
unsigned char *pVolumeName, //OPTIONAL
unsigned char *pDirPath //OPTIONAL
);
unsigned int
SetDriveBase(
unsigned short DriveNumber,
unsigned char *ServerName,
unsigned int DirHandle,
unsigned char *pDirPath
);
unsigned int
DeleteDriveBase(
unsigned short DriveNumber
);
unsigned int
GetDirectoryPath(
unsigned char ConnectionHandle,
unsigned char Handle,
unsigned char *pPath
);
unsigned int
IsDriveRemote(
unsigned char DriveNumber,
unsigned int *pRemote
);
/** CAPTURE.C **/
unsigned int
EndCapture(
unsigned char LPTDevice
);
#define PS_ERR_BAD_VERSION 0x7770
#define PS_ERR_GETTING_DEFAULT 0x7773
#define PS_ERR_OPENING_DB 0x7774
#define PS_ERR_READING_DB 0x7775
#define PS_ERR_READING_RECORD 0x7776
#define PS_ERR_INTERNAL_ERROR 0x7779
#define PS_ERR_NO_DEFAULT_SPECIFIED 0x777B
unsigned int
PSJobGetDefault(
unsigned int ConnectionHandle,
unsigned short SearchFlag,
unsigned char *pOwner,
unsigned char *pJobName,
PPS_JOB_RECORD pJobRecord
);
unsigned int
PSJobRead(
unsigned int ConnectionHandle,
unsigned char *pOwner,
unsigned char *pJobName,
PPS_JOB_RECORD pJobRecord
);
unsigned int
PS40JobGetDefault(
unsigned int NDSCaptureFlag,
unsigned short SearchFlag,
unsigned char *pOwner,
unsigned char *pJobName,
PPS_JOB_RECORD pJobRecord
);
unsigned int
PS40JobRead(
unsigned int NDSCaptureFlag,
unsigned char *pOwner,
unsigned char *pJobName,
PPS_JOB_RECORD pJobRecord
);
unsigned int
GetCaptureFlags(
unsigned char LPTDevice,
PNETWARE_CAPTURE_FLAGS_RW pCaptureFlagsRW,
PNETWARE_CAPTURE_FLAGS_RO pCaptureFlagsRO
);
unsigned int
StartQueueCapture(
unsigned int ConnectionHandle,
unsigned char LPTDevice,
unsigned char *pServerName,
unsigned char *pQueueName
);
unsigned int
GetDefaultPrinterQueue (
unsigned int ConnectionHandle,
unsigned char *pServerName,
unsigned char *pQueueName
);
#endif /* _NWLIBS_H_ */
|