summaryrefslogtreecommitdiffstats
path: root/private/mvdm/wow16/wfwnet
diff options
context:
space:
mode:
Diffstat (limited to 'private/mvdm/wow16/wfwnet')
-rw-r--r--private/mvdm/wow16/wfwnet/bseerr.h617
-rw-r--r--private/mvdm/wow16/wfwnet/ints.asm145
-rw-r--r--private/mvdm/wow16/wfwnet/lfn.c162
-rw-r--r--private/mvdm/wow16/wfwnet/libentry.asm83
-rw-r--r--private/mvdm/wow16/wfwnet/locals.h153
-rw-r--r--private/mvdm/wow16/wfwnet/makefile140
-rw-r--r--private/mvdm/wow16/wfwnet/misc.c265
-rw-r--r--private/mvdm/wow16/wfwnet/print.c132
-rw-r--r--private/mvdm/wow16/wfwnet/to32.c1268
-rw-r--r--private/mvdm/wow16/wfwnet/wfwnet.c844
-rw-r--r--private/mvdm/wow16/wfwnet/wfwnet.def102
-rw-r--r--private/mvdm/wow16/wfwnet/wfwnet.rc4
-rw-r--r--private/mvdm/wow16/wfwnet/wfwnet.rcv12
13 files changed, 3927 insertions, 0 deletions
diff --git a/private/mvdm/wow16/wfwnet/bseerr.h b/private/mvdm/wow16/wfwnet/bseerr.h
new file mode 100644
index 000000000..f0c76ad18
--- /dev/null
+++ b/private/mvdm/wow16/wfwnet/bseerr.h
@@ -0,0 +1,617 @@
+/****************************** Module Header ******************************\
+*
+* Module Name: BSEERR.H
+*
+* Copy of the Lanman BSEERR.H used for their base error codes.
+* Not used by anyone else.
+*
+\***************************************************************************/
+
+#ifndef BSEERR_INCLUDED
+#define BSEERR_INCLUDED
+
+#define NO_ERROR 0
+#define ERROR_INVALID_FUNCTION 1
+#define ERROR_FILE_NOT_FOUND 2
+#define ERROR_PATH_NOT_FOUND 3
+#define ERROR_TOO_MANY_OPEN_FILES 4
+#define ERROR_ACCESS_DENIED 5
+#define ERROR_INVALID_HANDLE 6
+#define ERROR_ARENA_TRASHED 7
+#define ERROR_NOT_ENOUGH_MEMORY 8
+#define ERROR_INVALID_BLOCK 9
+#define ERROR_BAD_ENVIRONMENT 10
+#define ERROR_BAD_FORMAT 11
+#define ERROR_INVALID_ACCESS 12
+#define ERROR_INVALID_DATA 13
+/* 14 is reserved */
+#define ERROR_INVALID_DRIVE 15
+#define ERROR_CURRENT_DIRECTORY 16
+#define ERROR_NOT_SAME_DEVICE 17
+#define ERROR_NO_MORE_FILES 18
+#define ERROR_WRITE_PROTECT 19
+#define ERROR_BAD_UNIT 20
+#define ERROR_NOT_READY 21
+#define ERROR_BAD_COMMAND 22
+#define ERROR_CRC 23
+#define ERROR_BAD_LENGTH 24
+#define ERROR_SEEK 25
+#define ERROR_NOT_DOS_DISK 26
+#define ERROR_SECTOR_NOT_FOUND 27
+#define ERROR_OUT_OF_PAPER 28
+#define ERROR_WRITE_FAULT 29
+#define ERROR_READ_FAULT 30
+#define ERROR_GEN_FAILURE 31
+#define ERROR_SHARING_VIOLATION 32
+#define ERROR_LOCK_VIOLATION 33
+#define ERROR_WRONG_DISK 34
+#define ERROR_FCB_UNAVAILABLE 35
+#define ERROR_SHARING_BUFFER_EXCEEDED 36
+#define ERROR_NOT_SUPPORTED 50
+#define ERROR_REM_NOT_LIST 51 /* Remote computer not listening */
+#define ERROR_DUP_NAME 52 /* Duplicate name on network */
+#define ERROR_BAD_NETPATH 53 /* Network path not found */
+#define ERROR_NETWORK_BUSY 54 /* Network busy */
+#define ERROR_DEV_NOT_EXIST 55 /* Network device no longer exists */
+#define ERROR_TOO_MANY_CMDS 56 /* Net BIOS command limit exceeded */
+#define ERROR_ADAP_HDW_ERR 57 /* Network adapter hardware error */
+#define ERROR_BAD_NET_RESP 58 /* Incorrect response from network */
+#define ERROR_UNEXP_NET_ERR 59 /* Unexpected network error */
+#define ERROR_BAD_REM_ADAP 60 /* Incompatible remote adapter */
+#define ERROR_PRINTQ_FULL 61 /* Print queue full */
+#define ERROR_NO_SPOOL_SPACE 62 /* Not enough space for print file */
+#define ERROR_PRINT_CANCELLED 63 /* Print file was cancelled */
+#define ERROR_NETNAME_DELETED 64 /* Network name was deleted */
+#define ERROR_NETWORK_ACCESS_DENIED 65 /* Access denied */
+#define ERROR_BAD_DEV_TYPE 66 /* Network device type incorrect */
+#define ERROR_BAD_NET_NAME 67 /* Network name not found */
+#define ERROR_TOO_MANY_NAMES 68 /* Network name limit exceeded */
+#define ERROR_TOO_MANY_SESS 69 /* Net BIOS session limit exceeded */
+#define ERROR_SHARING_PAUSED 70 /* Sharing temporarily paused */
+#define ERROR_REQ_NOT_ACCEP 71 /* Network request not accepted */
+#define ERROR_REDIR_PAUSED 72 /* Print|disk redirection is paused*/
+#define ERROR_FILE_EXISTS 80
+#define ERROR_DUP_FCB 81
+#define ERROR_CANNOT_MAKE 82
+#define ERROR_FAIL_I24 83
+#define ERROR_OUT_OF_STRUCTURES 84
+#define ERROR_ALREADY_ASSIGNED 85
+#define ERROR_INVALID_PASSWORD 86
+#define ERROR_INVALID_PARAMETER 87
+#define ERROR_NET_WRITE_FAULT 88
+#define ERROR_NO_PROC_SLOTS 89 /* no process slots available */
+#define ERROR_NOT_FROZEN 90
+#define ERR_TSTOVFL 91 /* timer service table overflow */
+#define ERR_TSTDUP 92 /* timer service table duplicate */
+#define ERROR_NO_ITEMS 93 /* no items to operate upon */
+#define ERROR_INTERRUPT 95 /* interrupted system call */
+#define ERROR_DEVICE_IN_USE 99 /* Device in use by another thread */
+#define ERROR_TOO_MANY_SEMAPHORES 100
+#define ERROR_EXCL_SEM_ALREADY_OWNED 101
+#define ERROR_SEM_IS_SET 102
+#define ERROR_TOO_MANY_SEM_REQUESTS 103
+#define ERROR_INVALID_AT_INTERRUPT_TIME 104
+#define ERROR_SEM_OWNER_DIED 105 /* waitsem found owner died */
+#define ERROR_SEM_USER_LIMIT 106 /* too many procs have this sem */
+#define ERROR_DISK_CHANGE 107
+#define ERROR_DRIVE_LOCKED 108 /* drive locked by another process*/
+#define ERROR_BROKEN_PIPE 109 /* write on pipe with no reader */
+#define ERROR_OPEN_FAILED 110 /* open/created failed due to */
+ /* explicit fail command */
+#define ERROR_BUFFER_OVERFLOW 111 /* buffer passed to system call */
+ /* is too small to hold return */
+ /* data. */
+#define ERROR_DISK_FULL 112 /* not enough space on the disk */
+ /* (DOSNEWSIZE/w_NewSize) */
+#define ERROR_NO_MORE_SEARCH_HANDLES 113 /* can't allocate another search */
+ /* structure and handle. */
+ /* (DOSFINDFIRST/w_FindFirst) */
+#define ERROR_INVALID_TARGET_HANDLE 114 /* Target handle in DOSDUPHANDLE */
+ /* is invalid */
+#define ERROR_PROTECTION_VIOLATION 115 /* Bad user virtual address */
+#define ERROR_VIOKBD_REQUEST 116
+#define ERROR_INVALID_CATEGORY 117 /* Category for DEVIOCTL in not */
+ /* defined */
+#define ERROR_INVALID_VERIFY_SWITCH 118 /* invalid value passed for */
+ /* verify flag */
+#define ERROR_BAD_DRIVER_LEVEL 119 /* DosDevIOCTL looks for a level */
+ /* four driver. If the driver */
+ /* is not level four we return */
+ /* this code */
+#define ERROR_CALL_NOT_IMPLEMENTED 120 /* returned from stub api calls. */
+ /* This call will disappear when */
+ /* all the api's are implemented. */
+#define ERROR_SEM_TIMEOUT 121 /* Time out happened from the */
+ /* semaphore api functions. */
+#define ERROR_INSUFFICIENT_BUFFER 122 /* Some calls require the */
+ /* application to pass in a buffer */
+ /* filled with data. This error is */
+ /* returned if the data buffer is too */
+ /* small. For example: DosSetFileInfo */
+ /* requires 4 bytes of data. If a */
+ /* two byte buffer is passed in then */
+ /* this error is returned. */
+ /* error_buffer_overflow is used when */
+ /* the output buffer in not big enough.*/
+#define ERROR_INVALID_NAME 123 /* illegal character or malformed */
+ /* file system name */
+#define ERROR_INVALID_LEVEL 124 /* unimplemented level for info */
+ /* retrieval or setting */
+#define ERROR_NO_VOLUME_LABEL 125 /* no volume label found with */
+ /* DosQFSInfo command */
+#define ERROR_MOD_NOT_FOUND 126 /* w_getprocaddr,w_getmodhandle */
+#define ERROR_PROC_NOT_FOUND 127 /* w_getprocaddr */
+#define ERROR_WAIT_NO_CHILDREN 128 /* CWait finds to children */
+#define ERROR_CHILD_NOT_COMPLETE 129 /* CWait children not dead yet */
+#define ERROR_DIRECT_ACCESS_HANDLE 130 /* handle operation is invalid */
+ /* for direct disk access */
+ /* handles */
+#define ERROR_NEGATIVE_SEEK 131 /* application tried to seek */
+ /* with negitive offset */
+#define ERROR_SEEK_ON_DEVICE 132 /* application tried to seek */
+ /* on device or pipe */
+#define ERROR_IS_JOIN_TARGET 133
+#define ERROR_IS_JOINED 134
+#define ERROR_IS_SUBSTED 135
+#define ERROR_NOT_JOINED 136
+#define ERROR_NOT_SUBSTED 137
+#define ERROR_JOIN_TO_JOIN 138
+#define ERROR_SUBST_TO_SUBST 139
+#define ERROR_JOIN_TO_SUBST 140
+#define ERROR_SUBST_TO_JOIN 141
+#define ERROR_BUSY_DRIVE 142
+#define ERROR_SAME_DRIVE 143
+#define ERROR_DIR_NOT_ROOT 144
+#define ERROR_DIR_NOT_EMPTY 145
+#define ERROR_IS_SUBST_PATH 146
+#define ERROR_IS_JOIN_PATH 147
+#define ERROR_PATH_BUSY 148
+#define ERROR_IS_SUBST_TARGET 149
+#define ERROR_SYSTEM_TRACE 150 /* system trace error */
+#define ERROR_INVALID_EVENT_COUNT 151 /* DosMuxSemWait errors */
+#define ERROR_TOO_MANY_MUXWAITERS 152
+#define ERROR_INVALID_LIST_FORMAT 153
+#define ERROR_LABEL_TOO_LONG 154
+#define ERROR_TOO_MANY_TCBS 155
+#define ERROR_SIGNAL_REFUSED 156
+#define ERROR_DISCARDED 157
+#define ERROR_NOT_LOCKED 158
+#define ERROR_BAD_THREADID_ADDR 159
+#define ERROR_BAD_ARGUMENTS 160
+#define ERROR_BAD_PATHNAME 161
+#define ERROR_SIGNAL_PENDING 162
+#define ERROR_UNCERTAIN_MEDIA 163
+#define ERROR_MAX_THRDS_REACHED 164
+#define ERROR_MONITORS_NOT_SUPPORTED 165
+#define ERROR_UNC_DRIVER_NOT_INSTALLED 166
+
+/* The following error codes refer to demand loading segments */
+#define ERROR_LOCK_FAILED 167
+#define ERROR_SWAPIO_FAILED 168
+#define ERROR_SWAPIN_FAILED 169
+#define ERROR_BUSY 170
+
+#define ERROR_INVALID_SEGMENT_NUMBER 180
+#define ERROR_INVALID_CALLGATE 181
+#define ERROR_INVALID_ORDINAL 182
+#define ERROR_ALREADY_EXISTS 183
+#define ERROR_NO_CHILD_PROCESS 184
+#define ERROR_CHILD_ALIVE_NOWAIT 185
+#define ERROR_INVALID_FLAG_NUMBER 186
+#define ERROR_SEM_NOT_FOUND 187
+
+/* following error codes make loader error messages distinct */
+#define ERROR_INVALID_STARTING_CODESEG 188
+#define ERROR_INVALID_STACKSEG 189
+#define ERROR_INVALID_MODULETYPE 190
+#define ERROR_INVALID_EXE_SIGNATURE 191
+#define ERROR_EXE_MARKED_INVALID 192
+#define ERROR_BAD_EXE_FORMAT 193
+#define ERROR_ITERATED_DATA_EXCEEDS_64K 194
+#define ERROR_INVALID_MINALLOCSIZE 195
+#define ERROR_DYNLINK_FROM_INVALID_RING 196
+#define ERROR_IOPL_NOT_ENABLED 197
+#define ERROR_INVALID_SEGDPL 198
+#define ERROR_AUTODATASEG_EXCEEDS_64k 199
+#define ERROR_RING2SEG_MUST_BE_MOVABLE 200
+#define ERROR_RELOC_CHAIN_XEEDS_SEGLIM 201
+#define ERROR_INFLOOP_IN_RELOC_CHAIN 202
+#define ERROR_ENVVAR_NOT_FOUND 203
+#define ERROR_NOT_CURRENT_CTRY 204
+#define ERROR_NO_SIGNAL_SENT 205
+#define ERROR_FILENAME_EXCED_RANGE 206 /* if filename > 8.3 */
+#define ERROR_RING2_STACK_IN_USE 207 /* for FAPI */
+#define ERROR_META_EXPANSION_TOO_LONG 208 /* if "*a" > 8.3 */
+#define ERROR_INVALID_SIGNAL_NUMBER 209
+#define ERROR_THREAD_1_INACTIVE 210
+#define ERROR_INFO_NOT_AVAIL 211
+#define ERROR_LOCKED 212
+#define ERROR_BAD_DYNALINK 213
+#define ERROR_TOO_MANY_MODULES 214
+#define ERROR_NESTING_NOT_ALLOWED 215
+#define ERROR_CANNOT_SHRINK 216 /* attempt to shrink ring 2 stack */
+#define ERROR_ZOMBIE_PROCESS 217
+#define ERROR_STACK_IN_HIGH_MEMORY 218
+#define ERROR_INVALID_EXITROUTINE_RING 219
+#define ERROR_GETBUF_FAILED 220
+#define ERROR_FLUSHBUF_FAILED 221
+#define ERROR_TRANSFER_TOO_LONG 222
+#define ERROR_NO_CHILDREN 228
+#define ERROR_INVALID_SCREEN_GROUP 229
+/*
+ * Error codes 230 - 249 are reserved
+ */
+#define ERROR_BAD_PIPE 230 /* Non-existant pipe or bad operation */
+#define ERROR_PIPE_BUSY 231 /* Pipe is busy */
+#define ERROR_NO_DATA 232 /* No data on non-blocking read */
+#define ERROR_PIPE_NOT_CONNECTED 233 /* Pipe was disconnected by server*/
+#define ERROR_MORE_DATA 234 /* More data is available */
+
+#define ERROR_VC_DISCONNECTED 240
+#define ERROR_CIRCULARITY_REQUESTED 250 /* When renaming a dir which */
+ /* would cause a circularity */
+#define ERROR_DIRECTORY_IN_CDS 251 /* When renaming a dir */
+ /* which is "in use" */
+#define ERROR_INVALID_FSD_NAME 252 /* when trying to access */
+ /* nonexistent FSD */
+#define ERROR_INVALID_PATH 253 /* bad pseudo device */
+#define ERROR_INVALID_EA_NAME 254 /* Illegal chars in name */
+#define ERROR_EA_LIST_INCONSISTENT 255 /* Size or some field bad */
+#define ERROR_EA_LIST_TOO_LONG 256 /* FEAlist > 64K-1 bytes */
+#define ERROR_NO_META_MATCH 257 /* string doesn't match expression*/
+#define ERROR_FINDNOTIFY_TIMEOUT 258 /* FindNotify request timeout */
+#define ERROR_NO_MORE_ITEMS 259 /* QFSAttach ordinal query */
+#define ERROR_SEARCH_STRUC_REUSED 260 /* 3xbox findfirst/next
+ search structure reused */
+#define ERROR_CHAR_NOT_FOUND 261 /* can not find character */
+#define ERROR_TOO_MUCH_STACK 262 /* Stack request exceeds sys limit*/
+#define ERROR_INVALID_ATTR 263 /* invalid FS_ATTRIBUTE */
+#define ERROR_INVALID_STARTING_RING 264
+#define ERROR_INVALID_DLL_INIT_RING 265
+#define ERROR_CANNOT_COPY 266 /* doscopy */
+#define ERROR_DIRECTORY 267 /* doscopy */
+#define ERROR_OPLOCKED_FILE 268
+#define ERROR_OPLOCK_THREAD_EXISTS 269
+
+/* error codes for DosFindNotify */
+#define ERROR_VOLUME_CHANGED 270
+#define ERROR_FINDNOTIFY_HANDLE_IN_USE 271
+#define ERROR_FINDNOTIFY_HANDLE_CLOSED 272
+#define ERROR_NOTIFY_OBJECT_REMOVED 273
+
+/* Error to indicate that ShutDown already done */
+#define ERROR_ALREADY_SHUTDOWN 274
+
+/* error code for DOSFINDFIRST2/NEXT */
+#define ERROR_EAS_DIDNT_FIT 275
+
+/* error codes for EA file format change */
+#define ERROR_EA_FILE_CORRUPT 276
+#define ERROR_EA_TABLE_FULL 277
+#define ERROR_INVALID_EA_HANDLE 278
+#define ERROR_NO_CLUSTER 279
+#define ERROR_CREATE_EA_FILE 280
+#define ERROR_CANNOT_OPEN_EA_FILE 281
+
+#define ERROR_INVALID_PROCID 303
+#define ERROR_INVALID_PDELTA 304
+#define ERROR_NOT_DESCENDANT 305
+#define ERROR_NOT_SESSION_MANAGER 306
+#define ERROR_INVALID_PCLASS 307
+#define ERROR_INVALID_SCOPE 308
+#define ERROR_INVALID_THREADID 309
+#define ERROR_DOSSUB_SHRINK 310
+#define ERROR_DOSSUB_NOMEM 311
+#define ERROR_DOSSUB_OVERLAP 312
+#define ERROR_DOSSUB_BADSIZE 313
+#define ERROR_DOSSUB_BADFLAG 314
+#define ERROR_DOSSUB_BADSELECTOR 315
+#define ERROR_MR_MSG_TOO_LONG 316
+#define ERROR_MR_MID_NOT_FOUND 317
+#define ERROR_MR_UN_ACC_MSGF 318
+#define ERROR_MR_INV_MSGF_FORMAT 319
+#define ERROR_MR_INV_IVCOUNT 320
+#define ERROR_MR_UN_PERFORM 321
+#define ERROR_TS_WAKEUP 322
+#define ERROR_TS_SEMHANDLE 323
+#define ERROR_TS_NOTIMER 324
+#define ERROR_TS_HANDLE 326
+#define ERROR_TS_DATETIME 327
+#define ERROR_SYS_INTERNAL 328
+#define ERROR_QUE_CURRENT_NAME 329
+#define ERROR_QUE_PROC_NOT_OWNED 330
+#define ERROR_QUE_PROC_OWNED 331
+#define ERROR_QUE_DUPLICATE 332
+#define ERROR_QUE_ELEMENT_NOT_EXIST 333
+#define ERROR_QUE_NO_MEMORY 334
+#define ERROR_QUE_INVALID_NAME 335
+#define ERROR_QUE_INVALID_PRIORITY 336
+#define ERROR_QUE_INVALID_HANDLE 337
+#define ERROR_QUE_LINK_NOT_FOUND 338
+#define ERROR_QUE_MEMORY_ERROR 339
+#define ERROR_QUE_PREV_AT_END 340
+#define ERROR_QUE_PROC_NO_ACCESS 341
+#define ERROR_QUE_EMPTY 342
+#define ERROR_QUE_NAME_NOT_EXIST 343
+#define ERROR_QUE_NOT_INITIALIZED 344
+#define ERROR_QUE_UNABLE_TO_ACCESS 345
+#define ERROR_QUE_UNABLE_TO_ADD 346
+#define ERROR_QUE_UNABLE_TO_INIT 347
+#define ERROR_VIO_INVALID_MASK 349
+#define ERROR_VIO_PTR 350
+#define ERROR_VIO_APTR 351
+#define ERROR_VIO_RPTR 352
+#define ERROR_VIO_CPTR 353
+#define ERROR_VIO_LPTR 354
+#define ERROR_VIO_MODE 355
+#define ERROR_VIO_WIDTH 356
+#define ERROR_VIO_ATTR 357
+#define ERROR_VIO_ROW 358
+#define ERROR_VIO_COL 359
+#define ERROR_VIO_TOPROW 360
+#define ERROR_VIO_BOTROW 361
+#define ERROR_VIO_RIGHTCOL 362
+#define ERROR_VIO_LEFTCOL 363
+#define ERROR_SCS_CALL 364
+#define ERROR_SCS_VALUE 365
+#define ERROR_VIO_WAIT_FLAG 366
+#define ERROR_VIO_UNLOCK 367
+#define ERROR_SGS_NOT_SESSION_MGR 368
+#define ERROR_SMG_INVALID_SGID 369
+#define ERROR_SMG_INVALID_SESSION_ID 369
+#define ERROR_SMG_NOSG 370
+#define ERROR_SMG_NO_SESSIONS 370
+#define ERROR_SMG_GRP_NOT_FOUND 371
+#define ERROR_SMG_SESSION_NOT_FOUND 371
+#define ERROR_SMG_SET_TITLE 372
+#define ERROR_KBD_PARAMETER 373
+#define ERROR_KBD_NO_DEVICE 374
+#define ERROR_KBD_INVALID_IOWAIT 375
+#define ERROR_KBD_INVALID_LENGTH 376
+#define ERROR_KBD_INVALID_ECHO_MASK 377
+#define ERROR_KBD_INVALID_INPUT_MASK 378
+#define ERROR_MON_INVALID_PARMS 379
+#define ERROR_MON_INVALID_DEVNAME 380
+#define ERROR_MON_INVALID_HANDLE 381
+#define ERROR_MON_BUFFER_TOO_SMALL 382
+#define ERROR_MON_BUFFER_EMPTY 383
+#define ERROR_MON_DATA_TOO_LARGE 384
+#define ERROR_MOUSE_NO_DEVICE 385
+#define ERROR_MOUSE_INV_HANDLE 386
+#define ERROR_MOUSE_INV_PARMS 387
+#define ERROR_MOUSE_CANT_RESET 388
+#define ERROR_MOUSE_DISPLAY_PARMS 389
+#define ERROR_MOUSE_INV_MODULE 390
+#define ERROR_MOUSE_INV_ENTRY_PT 391
+#define ERROR_MOUSE_INV_MASK 392
+#define NO_ERROR_MOUSE_NO_DATA 393
+#define NO_ERROR_MOUSE_PTR_DRAWN 394
+#define ERROR_INVALID_FREQUENCY 395
+#define ERROR_NLS_NO_COUNTRY_FILE 396
+#define ERROR_NLS_OPEN_FAILED 397
+#define ERROR_NLS_NO_CTRY_CODE 398
+#define ERROR_NO_COUNTRY_OR_CODEPAGE 398
+#define ERROR_NLS_TABLE_TRUNCATED 399
+#define ERROR_NLS_BAD_TYPE 400
+#define ERROR_NLS_TYPE_NOT_FOUND 401
+#define ERROR_VIO_SMG_ONLY 402
+#define ERROR_VIO_INVALID_ASCIIZ 403
+#define ERROR_VIO_DEREGISTER 404
+#define ERROR_VIO_NO_POPUP 405
+#define ERROR_VIO_EXISTING_POPUP 406
+#define ERROR_KBD_SMG_ONLY 407
+#define ERROR_KBD_INVALID_ASCIIZ 408
+#define ERROR_KBD_INVALID_MASK 409
+#define ERROR_KBD_REGISTER 410
+#define ERROR_KBD_DEREGISTER 411
+#define ERROR_MOUSE_SMG_ONLY 412
+#define ERROR_MOUSE_INVALID_ASCIIZ 413
+#define ERROR_MOUSE_INVALID_MASK 414
+#define ERROR_MOUSE_REGISTER 415
+#define ERROR_MOUSE_DEREGISTER 416
+#define ERROR_SMG_BAD_ACTION 417
+#define ERROR_SMG_INVALID_CALL 418
+#define ERROR_SCS_SG_NOTFOUND 419
+#define ERROR_SCS_NOT_SHELL 420
+#define ERROR_VIO_INVALID_PARMS 421
+#define ERROR_VIO_FUNCTION_OWNED 422
+#define ERROR_VIO_RETURN 423
+#define ERROR_SCS_INVALID_FUNCTION 424
+#define ERROR_SCS_NOT_SESSION_MGR 425
+#define ERROR_VIO_REGISTER 426
+#define ERROR_VIO_NO_MODE_THREAD 427
+#define ERROR_VIO_NO_SAVE_RESTORE_THD 428
+#define ERROR_VIO_IN_BG 429
+#define ERROR_VIO_ILLEGAL_DURING_POPUP 430
+#define ERROR_SMG_NOT_BASESHELL 431
+#define ERROR_SMG_BAD_STATUSREQ 432
+#define ERROR_QUE_INVALID_WAIT 433
+#define ERROR_VIO_LOCK 434
+#define ERROR_MOUSE_INVALID_IOWAIT 435
+#define ERROR_VIO_INVALID_HANDLE 436
+#define ERROR_VIO_ILLEGAL_DURING_LOCK 437
+#define ERROR_VIO_INVALID_LENGTH 438
+#define ERROR_KBD_INVALID_HANDLE 439
+#define ERROR_KBD_NO_MORE_HANDLE 440
+#define ERROR_KBD_CANNOT_CREATE_KCB 441
+#define ERROR_KBD_CODEPAGE_LOAD_INCOMPL 442
+#define ERROR_KBD_INVALID_CODEPAGE_ID 443
+#define ERROR_KBD_NO_CODEPAGE_SUPPORT 444
+#define ERROR_KBD_FOCUS_REQUIRED 445
+#define ERROR_KBD_FOCUS_ALREADY_ACTIVE 446
+#define ERROR_KBD_KEYBOARD_BUSY 447
+#define ERROR_KBD_INVALID_CODEPAGE 448
+#define ERROR_KBD_UNABLE_TO_FOCUS 449
+#define ERROR_SMG_SESSION_NON_SELECT 450
+#define ERROR_SMG_SESSION_NOT_FOREGRND 451
+#define ERROR_SMG_SESSION_NOT_PARENT 452
+#define ERROR_SMG_INVALID_START_MODE 453
+#define ERROR_SMG_INVALID_RELATED_OPT 454
+#define ERROR_SMG_INVALID_BOND_OPTION 455
+#define ERROR_SMG_INVALID_SELECT_OPT 456
+#define ERROR_SMG_START_IN_BACKGROUND 457
+#define ERROR_SMG_INVALID_STOP_OPTION 458
+#define ERROR_SMG_BAD_RESERVE 459
+#define ERROR_SMG_PROCESS_NOT_PARENT 460
+#define ERROR_SMG_INVALID_DATA_LENGTH 461
+#define ERROR_SMG_NOT_BOUND 462
+#define ERROR_SMG_RETRY_SUB_ALLOC 463
+#define ERROR_KBD_DETACHED 464
+#define ERROR_VIO_DETACHED 465
+#define ERROR_MOU_DETACHED 466
+#define ERROR_VIO_FONT 467
+#define ERROR_VIO_USER_FONT 468
+#define ERROR_VIO_BAD_CP 469
+#define ERROR_VIO_NO_CP 470
+#define ERROR_VIO_NA_CP 471
+#define ERROR_INVALID_CODE_PAGE 472
+#define ERROR_CPLIST_TOO_SMALL 473
+#define ERROR_CP_NOT_MOVED 474
+#define ERROR_MODE_SWITCH_INIT 475
+#define ERROR_CODE_PAGE_NOT_FOUND 476
+#define ERROR_UNEXPECTED_SLOT_RETURNED 477
+#define ERROR_SMG_INVALID_TRACE_OPTION 478
+#define ERROR_VIO_INTERNAL_RESOURCE 479
+#define ERROR_VIO_SHELL_INIT 480
+#define ERROR_SMG_NO_HARD_ERRORS 481
+#define ERROR_CP_SWITCH_INCOMPLETE 482
+#define ERROR_VIO_TRANSPARENT_POPUP 483
+#define ERROR_CRITSEC_OVERFLOW 484
+#define ERROR_CRITSEC_UNDERFLOW 485
+#define ERROR_VIO_BAD_RESERVE 486
+#define ERROR_INVALID_ADDRESS 487
+#define ERROR_ZERO_SELECTORS_REQUESTED 488
+#define ERROR_NOT_ENOUGH_SELECTORS_AVA 489
+#define ERROR_INVALID_SELECTOR 490
+#define ERROR_SMG_INVALID_PROGRAM_TYPE 491
+#define ERROR_SMG_INVALID_PGM_CONTROL 492
+#define ERROR_SMG_INVALID_INHERIT_OPT 493
+#define ERROR_VIO_EXTENDED_SG 494
+#define ERROR_VIO_NOT_PRES_MGR_SG 495
+#define ERROR_VIO_SHIELD_OWNED 496
+#define ERROR_VIO_NO_MORE_HANDLES 497
+#define ERROR_VIO_SEE_ERROR_LOG 498
+#define ERROR_VIO_ASSOCIATED_DC 499
+#define ERROR_KBD_NO_CONSOLE 500
+#define ERROR_MOUSE_NO_CONSOLE 501
+#define ERROR_MOUSE_INVALID_HANDLE 502
+#define ERROR_SMG_INVALID_DEBUG_PARMS 503
+#define ERROR_KBD_EXTENDED_SG 504
+#define ERROR_MOU_EXTENDED_SG 505
+#define ERROR_SMG_INVALID_ICON_FILE 506
+
+
+#define ERROR_USER_DEFINED_BASE 0xFF00
+
+#define ERROR_I24_WRITE_PROTECT 0
+#define ERROR_I24_BAD_UNIT 1
+#define ERROR_I24_NOT_READY 2
+#define ERROR_I24_BAD_COMMAND 3
+#define ERROR_I24_CRC 4
+#define ERROR_I24_BAD_LENGTH 5
+#define ERROR_I24_SEEK 6
+#define ERROR_I24_NOT_DOS_DISK 7
+#define ERROR_I24_SECTOR_NOT_FOUND 8
+#define ERROR_I24_OUT_OF_PAPER 9
+#define ERROR_I24_WRITE_FAULT 10
+#define ERROR_I24_READ_FAULT 11
+#define ERROR_I24_GEN_FAILURE 12
+#define ERROR_I24_DISK_CHANGE 13
+#define ERROR_I24_WRONG_DISK 15
+#define ERROR_I24_UNCERTAIN_MEDIA 16
+#define ERROR_I24_CHAR_CALL_INTERRUPTED 17
+#define ERROR_I24_NO_MONITOR_SUPPORT 18
+#define ERROR_I24_INVALID_PARAMETER 19
+#define ERROR_I24_DEVICE_IN_USE 20
+
+#define ALLOWED_FAIL 0x0001
+#define ALLOWED_ABORT 0x0002
+#define ALLOWED_RETRY 0x0004
+#define ALLOWED_IGNORE 0x0008
+#define ALLOWED_ACKNOWLEDGE 0x0010
+#define ALLOWED_DISPATCH 0x8000
+
+#define I24_OPERATION 0x01
+#define I24_AREA 0x06
+#define I24_CLASS 0x80
+
+/* Values for error CLASS */
+#define ERRCLASS_OUTRES 1 /* Out of Resource */
+#define ERRCLASS_TEMPSIT 2 /* Temporary Situation */
+#define ERRCLASS_AUTH 3 /* Permission problem */
+#define ERRCLASS_INTRN 4 /* Internal System Error */
+#define ERRCLASS_HRDFAIL 5 /* Hardware Failure */
+#define ERRCLASS_SYSFAIL 6 /* System Failure */
+#define ERRCLASS_APPERR 7 /* Application Error */
+#define ERRCLASS_NOTFND 8 /* Not Found */
+#define ERRCLASS_BADFMT 9 /* Bad Format */
+#define ERRCLASS_LOCKED 10 /* Locked */
+#define ERRCLASS_MEDIA 11 /* Media Failure */
+#define ERRCLASS_ALREADY 12 /* Collision with Existing Item */
+#define ERRCLASS_UNK 13 /* Unknown/other */
+#define ERRCLASS_CANT 14
+#define ERRCLASS_TIME 15
+
+/* Values for error ACTION */
+#define ERRACT_RETRY 1 /* Retry */
+#define ERRACT_DLYRET 2 /* Delay Retry, retry after pause */
+#define ERRACT_USER 3 /* Ask user to regive information */
+#define ERRACT_ABORT 4 /* abort with clean up */
+#define ERRACT_PANIC 5 /* abort immediately */
+#define ERRACT_IGNORE 6 /* ignore */
+#define ERRACT_INTRET 7 /* Retry after User Intervention */
+
+/* Values for error LOCUS */
+#define ERRLOC_UNK 1 /* No appropriate value */
+#define ERRLOC_DISK 2 /* Random Access Mass Storage */
+#define ERRLOC_NET 3 /* Network */
+#define ERRLOC_SERDEV 4 /* Serial Device */
+#define ERRLOC_MEM 5 /* Memory */
+
+/* Abnormal termination codes */
+#define TC_NORMAL 0
+#define TC_HARDERR 1
+#define TC_GP_TRAP 2
+#define TC_SIGNAL 3
+
+#define ERROR_SWAPPER_NOT_ACTIVE 32768
+#define ERROR_INVALID_SWAPID 32769
+#define ERROR_IOERR_SWAP_FILE 32770
+#define ERROR_SWAP_TABLE_FULL 32771
+#define ERROR_SWAP_FILE_FULL 32772
+#define ERROR_CANT_INIT_SWAPPER 32773
+#define ERROR_SWAPPER_ALREADY_INIT 32774
+#define ERROR_PMM_INSUFFICIENT_MEMORY 32775
+#define ERROR_PMM_INVALID_FLAGS 32776
+#define ERROR_PMM_INVALID_ADDRESS 32777
+#define ERROR_PMM_LOCK_FAILED 32778
+#define ERROR_PMM_UNLOCK_FAILED 32779
+#define ERROR_PMM_MOVE_INCOMPLETE 32780
+#define ERROR_UCOM_DRIVE_RENAMED 32781
+#define ERROR_UCOM_FILENAME_TRUNCATED 32782
+#define ERROR_UCOM_BUFFER_LENGTH 32783
+#define ERROR_MON_CHAIN_HANDLE 32784
+#define ERROR_MON_NOT_REGISTERED 32785
+#define ERROR_SMG_ALREADY_TOP 32786
+#define ERROR_PMM_ARENA_MODIFIED 32787
+#define ERROR_SMG_PRINTER_OPEN 32788
+#define ERROR_PMM_SET_FLAGS_FAILED 32789
+#define ERROR_INVALID_DOS_DD 32790
+#define ERROR_CPSIO_CODE_PAGE_INVALID 65026
+#define ERROR_CPSIO_NO_SPOOLER 65027
+#define ERROR_CPSIO_FONT_ID_INVALID 65028
+#define ERROR_CPSIO_INTERNAL_ERROR 65033
+#define ERROR_CPSIO_INVALID_PTR_NAME 65034
+#define ERROR_CPSIO_NOT_ACTIVE 65037
+#define ERROR_CPSIO_PID_FULL 65039
+#define ERROR_CPSIO_PID_NOT_FOUND 65040
+#define ERROR_CPSIO_READ_CTL_SEQ 65043
+#define ERROR_CPSIO_READ_FNT_DEF 65045
+#define ERROR_CPSIO_WRITE_ERROR 65047
+#define ERROR_CPSIO_WRITE_FULL_ERROR 65048
+#define ERROR_CPSIO_WRITE_HANDLE_BAD 65049
+#define ERROR_CPSIO_SWIT_LOAD 65074
+#define ERROR_CPSIO_INV_COMMAND 65077
+#define ERROR_CPSIO_NO_FONT_SWIT 65078
+
+#endif
diff --git a/private/mvdm/wow16/wfwnet/ints.asm b/private/mvdm/wow16/wfwnet/ints.asm
new file mode 100644
index 000000000..d605402ac
--- /dev/null
+++ b/private/mvdm/wow16/wfwnet/ints.asm
@@ -0,0 +1,145 @@
+include isvbop.inc
+
+.286
+.model medium,pascal
+
+_DATA segment word public 'DATA'
+
+Old2fHandler dd ?
+Old73Handler dd ?
+VddHandle dw -1
+
+DllName db "VWIPXSPX.DLL",0
+InitFunc db "VwInitialize",0
+DispFunc db "VwDispatcher",0
+
+_DATA ends
+
+INIT_TEXT segment byte public 'CODE'
+
+ assume cs:INIT_TEXT
+
+GrabInterrupts proc far
+ pusha
+ push ds
+ push es
+ push _DATA
+ pop ds
+ assume ds:_DATA
+ push ds
+ pop es
+ mov si,offset DllName ; ds:si = library name
+ mov di,offset InitFunc ; es:di = init function name
+ mov bx,offset DispFunc ; ds:bx = dispatcher function name
+ RegisterModule ; returns carry if problem
+ jc @f
+ mov VddHandle,ax
+ mov ax,352fh
+ int 21h
+ mov word ptr Old2fHandler,bx
+ mov word ptr Old2fHandler+2,es
+ mov ax,3573h
+ int 21h
+ mov word ptr Old73Handler,bx
+ mov word ptr Old73Handler+2,es
+ push seg PmIpx2fHandler
+ pop ds
+ assume ds:nothing
+ mov dx,offset PmIpx2fHandler
+ mov ax,252fh
+ int 21h
+ mov dx,offset PmIpx73Handler
+ mov ax,2573h
+ int 21h
+@@: pop es
+ pop ds
+ popa
+ ret
+GrabInterrupts endp
+
+INIT_TEXT ends
+
+_TEXT segment byte public 'CODE'
+
+ assume cs:_TEXT
+
+ public PmIpx2fHandler
+PmIpx2fHandler proc
+ cmp ax,1684h
+ jne @f
+ cmp bx,200h
+ jne @f
+ push cs
+ pop es
+ mov di,offset PmIpxEntryPoint
+ iret
+@@: push bp
+ mov bp,sp
+ push ax
+ push ds
+ mov ax,_DATA
+ mov ds,ax
+ assume ds:_DATA
+ push word ptr Old2fHandler+2
+ push word ptr Old2fHandler
+ mov ds,[bp-4]
+ mov ax,[bp-2]
+ mov bp,[bp]
+ retf 6
+PmIpx2fHandler endp
+
+ public PmIpx73Handler
+PmIpx73Handler proc
+ push ds
+ push es
+ pusha
+ mov bx,_DATA
+ mov ds,bx
+ assume ds:_DATA
+ mov ax,VddHandle
+ mov bx,-2
+ DispatchCall ; get ECB
+ jc @f
+ call dword ptr es:[si][4] ; branch to the ESR
+ mov al,20h
+ out 0a0h,al ; clear slave pic
+ out 20h,al ; " master "
+ popa
+ pop es
+ pop ds
+ assume ds:nothing
+ iret
+@@: popa
+ pop es
+ push bp
+ mov bp,sp
+ push _DATA
+ pop ds
+ assume ds:_DATA
+ push word ptr Old73Handler+2
+ push word ptr Old73Handler
+ mov ds,[bp+2]
+ assume ds:nothing
+ mov bp,[bp]
+ retf 4
+PmIpx73Handler endp
+
+ public PmIpxEntryPoint
+PmIpxEntryPoint proc
+ push bp
+ push ds
+ push _DATA
+ pop ds
+ assume ds:_DATA
+ mov bp,ax
+ mov ax,VddHandle
+ pop ds
+ assume ds:nothing
+ DispatchCall
+ pop bp
+ ret
+PmIpxEntryPoint endp
+
+_TEXT ends
+
+end
diff --git a/private/mvdm/wow16/wfwnet/lfn.c b/private/mvdm/wow16/wfwnet/lfn.c
new file mode 100644
index 000000000..a8996cb08
--- /dev/null
+++ b/private/mvdm/wow16/wfwnet/lfn.c
@@ -0,0 +1,162 @@
+/*++
+
+Copyright (c) 1989-1993 Microsoft Corporation
+
+Module Name:
+
+ lfn.c
+
+Abstract:
+
+ Provides entry points for the Long Name Functions from Win3.1
+ Network provider design.
+
+ All functions return WN_NOT_SUPPORTED
+
+Author:
+
+ Chuck Y Chan (ChuckC) 25-Mar-1993
+
+Revision History:
+
+
+--*/
+
+#include <windows.h>
+#include <locals.h>
+
+
+WORD API LFNFindFirst(LPSTR p1,
+ WORD p2,
+ LPINT p3,
+ LPINT p4,
+ WORD p5,
+ PFILEFINDBUF2 p6)
+{
+ UNREFERENCED(p1) ;
+ UNREFERENCED(p2) ;
+ UNREFERENCED(p3) ;
+ UNREFERENCED(p4) ;
+ UNREFERENCED(p5) ;
+ UNREFERENCED(p6) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API LFNFindNext(HANDLE p1,
+ LPINT p2,
+ WORD p3,
+ PFILEFINDBUF2 p4)
+{
+ UNREFERENCED(p1) ;
+ UNREFERENCED(p2) ;
+ UNREFERENCED(p3) ;
+ UNREFERENCED(p4) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API LFNFindClose(HANDLE p1)
+{
+ UNREFERENCED(p1) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API LFNGetAttributes(LPSTR p1,
+ LPINT p2)
+{
+ UNREFERENCED(p1) ;
+ UNREFERENCED(p2) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API LFNSetAttributes(LPSTR p1,
+ WORD p2)
+{
+ UNREFERENCED(p1) ;
+ UNREFERENCED(p2) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API LFNCopy(LPSTR p1,
+ LPSTR p2,
+ PQUERYPROC p3)
+{
+ UNREFERENCED(p1) ;
+ UNREFERENCED(p2) ;
+ UNREFERENCED(p3) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API LFNMove(LPSTR p1,
+ LPSTR p2)
+{
+ UNREFERENCED(p1) ;
+ UNREFERENCED(p2) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API LFNDelete(LPSTR p1)
+{
+ UNREFERENCED(p1) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API LFNMKDir(LPSTR p1)
+{
+ UNREFERENCED(p1) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API LFNRMDir(LPSTR p1)
+{
+ UNREFERENCED(p1) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API LFNGetVolumeLabel(WORD p1,
+ LPSTR p2)
+{
+ UNREFERENCED(p1) ;
+ UNREFERENCED(p2) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API LFNSetVolumeLabel(WORD p1,
+ LPSTR p2)
+{
+ UNREFERENCED(p1) ;
+ UNREFERENCED(p2) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API LFNParse(LPSTR p1,
+ LPSTR p2,
+ LPSTR p3)
+{
+ UNREFERENCED(p1) ;
+ UNREFERENCED(p2) ;
+ UNREFERENCED(p3) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API LFNVolumeType(WORD p1,
+ LPINT p2)
+{
+ UNREFERENCED(p1) ;
+ UNREFERENCED(p2) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
diff --git a/private/mvdm/wow16/wfwnet/libentry.asm b/private/mvdm/wow16/wfwnet/libentry.asm
new file mode 100644
index 000000000..b75d0cb9e
--- /dev/null
+++ b/private/mvdm/wow16/wfwnet/libentry.asm
@@ -0,0 +1,83 @@
+PAGE,132
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; LIBENTRY.ASM
+;
+; Windows dynamic link library entry routine
+;
+; This module generates a code segment called INIT_TEXT.
+; It initializes the local heap if one exists and then calls
+; the C routine LibMain() which should have the form:
+; BOOL FAR PASCAL LibMain(HANDLE hInstance,
+; WORD wDataSeg,
+; WORD cbHeap,
+; DWORD ignore); /* Always NULL - ignore */
+;
+; The result of the call to LibMain is returned to Windows.
+; The C routine should return TRUE if it completes initialization
+; successfully, FALSE if some error occurs.
+;
+; Note - The last parameter to LibMain is included for compatibility
+; reasons. Applications that wish to modify this file and remove the
+; parameter from LibMain may do so by simply removing the two
+; "push" instructions below marked with "****".
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+include cmacros.inc
+
+externFP <LibMain> ; the C routine to be called
+
+createSeg INIT_TEXT, INIT_TEXT, BYTE, PUBLIC, CODE
+sBegin INIT_TEXT
+assumes CS,INIT_TEXT
+
+?PLM=0 ; 'C'naming
+;externA <_acrtused> ; ensures that Win DLL startup code is linked
+
+?PLM=1 ; 'PASCAL' naming
+externFP <LocalInit> ; Windows heap init routine
+
+cProc LibEntry, <PUBLIC,FAR> ; entry point into DLL
+
+include CONVDLL.INC
+
+cBegin
+ push di ; handle of the module instance
+ push ds ; library data segment
+ push cx ; heap size
+ push es ; Always NULL **** May remove (see above)
+ push si ; Always NULL **** May remove (see above)
+
+ ; if we have some heap then initialize it
+ jcxz callc ; jump if no heap specified
+
+ ; call the Windows function LocalInit() to set up the heap
+ ; LocalInit((LPSTR)start, WORD cbHeap);
+
+ xor ax,ax
+ cCall LocalInit <ds, ax, cx>
+ or ax,ax ; did it do it ok ?
+ jz error ; quit if it failed
+
+ ; invoke the C routine to do any special initialization
+
+callc:
+ call LibMain ; invoke the 'C' routine (result in AX)
+ jmp short exit ; LibMain is responsible for stack clean up
+
+error:
+ pop si ; clean up stack on a LocalInit error
+ pop es
+ pop cx
+ pop ds
+ pop di
+
+exit:
+
+cEnd
+
+sEnd INIT_TEXT
+
+end LibEntry
+
diff --git a/private/mvdm/wow16/wfwnet/locals.h b/private/mvdm/wow16/wfwnet/locals.h
new file mode 100644
index 000000000..62c80808d
--- /dev/null
+++ b/private/mvdm/wow16/wfwnet/locals.h
@@ -0,0 +1,153 @@
+/*++
+
+Copyright (c) 1989-1993 Microsoft Corporation
+
+Module Name:
+
+ locals.h
+
+Abstract:
+
+ Provides the common definitions for this project.
+
+Author:
+
+ Chuck Y Chan (ChuckC) 25-Mar-1993
+
+Revision History:
+
+
+
+--*/
+
+#define LFN 1
+#include <winnet.h>
+#include <wfwnet.h>
+#include <spl_wnt.h>
+#include <bseerr.h>
+
+/*
+ * global manifests
+ */
+
+//
+// used to figure out how to get the last error.
+//
+#define LAST_CALL_IS_LOCAL (0)
+#define LAST_CALL_IS_LANMAN_DRV (1)
+#define LAST_CALL_IS_WIN32 (2)
+
+//
+// the various DLLs we rely on to do the real work.
+//
+#define LANMAN_DRV "LANMAN.DRV"
+#define MPR_DLL "MPR.DLL"
+#define MPRUI_DLL "MPRUI.DLL"
+#define NTLANMAN_DLL "NTLANMAN.DLL"
+#define KERNEL32_DLL "KERNEL32.DLL"
+#define WINSPOOL_DRV "WINSPOOL.DRV"
+
+//
+// some convenient manifests for above so we dont need to
+// do strcmp()s all the time.
+//
+#define USE_MPR_DLL (0)
+#define USE_MPRUI_DLL (1)
+#define USE_NTLANMAN_DLL (2)
+#define USE_KERNEL32_DLL (3)
+#define USE_WINSPOOL_DRV (4)
+
+//
+// resource type expected by Win32 APIs
+//
+#define RESOURCETYPE_ANY 0x00000000
+#define RESOURCETYPE_DISK 0x00000001
+#define RESOURCETYPE_PRINT 0x00000002
+#define RESOURCETYPE_ERROR 0xFFFFFFFF
+
+//
+// errors unknown in 16bit world.
+//
+#define WIN32_EXTENDED_ERROR 1208L
+#define WIN32_WN_CANCEL 1223L
+
+//
+// misc convenient macros
+//
+#define UNREFERENCED(x) (void)x
+#define TO_HWND32(x) (0xFFFF0000 | (DWORD)x)
+
+
+/*
+ * various typedefs for the 16 bit functions we dynamically load
+ */
+typedef void (API *LPFN)();
+typedef WORD (API *LPWNETOPENJOB)(LPSTR,LPSTR,WORD,LPINT);
+typedef WORD (API *LPWNETCLOSEJOB)(WORD,LPINT,LPSTR);
+typedef WORD (API *LPWNETWRITEJOB)(HANDLE,LPSTR,LPINT);
+typedef WORD (API *LPWNETABORTJOB)(WORD,LPSTR);
+typedef WORD (API *LPWNETHOLDJOB)(LPSTR,WORD);
+typedef WORD (API *LPWNETRELEASEJOB)(LPSTR,WORD);
+typedef WORD (API *LPWNETCANCELJOB)(LPSTR,WORD);
+typedef WORD (API *LPWNETSETJOBCOPIES)(LPSTR,WORD,WORD);
+typedef WORD (API *LPWNETWATCHQUEUE)(HWND,LPSTR,LPSTR,WORD);
+typedef WORD (API *LPWNETUNWATCHQUEUE)(LPSTR);
+typedef WORD (API *LPWNETLOCKQUEUEDATA)(LPSTR,LPSTR,LPQUEUESTRUCT FAR *);
+typedef WORD (API *LPWNETUNLOCKQUEUEDATA)(LPSTR);
+typedef WORD (API *LPWNETQPOLL)(HWND,WORD,WORD,LONG);
+typedef WORD (API *LPWNETDEVICEMODE)(HWND);
+typedef WORD (API *LPWNETVIEWQUEUEDIALOG)(HWND,LPSTR);
+typedef WORD (API *LPWNETGETCAPS)(WORD);
+typedef WORD (API *LPWNETGETERROR)(LPINT);
+typedef WORD (API *LPWNETGETERRORTEXT)(WORD,LPSTR,LPINT);
+
+typedef WORD (API *LPLFNFINDFIRST)(LPSTR,WORD,LPINT,LPINT,WORD,PFILEFINDBUF2);
+typedef WORD (API *LPLFNFINDNEXT)(HANDLE,LPINT,WORD,PFILEFINDBUF2);
+typedef WORD (API *LPLFNFINDCLOSE)(HANDLE);
+typedef WORD (API *LPLFNGETATTRIBUTES)(LPSTR,LPINT);
+typedef WORD (API *LPLFNSETATTRIBUTES)(LPSTR,WORD);
+typedef WORD (API *LPLFNCOPY)(LPSTR,LPSTR,PQUERYPROC);
+typedef WORD (API *LPLFNMOVE)(LPSTR,LPSTR);
+typedef WORD (API *LPLFNDELETE)(LPSTR);
+typedef WORD (API *LPLFNMKDIR)(LPSTR);
+typedef WORD (API *LPLFNRMDIR)(LPSTR);
+typedef WORD (API *LPLFNGETVOLUMELABEL)(WORD,LPSTR);
+typedef WORD (API *LPLFNSETVOLUMELABEL)(WORD,LPSTR);
+typedef WORD (API *LPLFNPARSE)(LPSTR,LPSTR,LPSTR);
+typedef WORD (API *LPLFNVOLUMETYPE)(WORD,LPINT);
+
+/*
+ * other misc global data/functions
+ */
+extern WORD vLastCall ;
+extern WORD vLastError ;
+extern WORD wNetTypeCaps ;
+extern WORD wUserCaps ;
+extern WORD wConnectionCaps ;
+extern WORD wErrorCaps ;
+extern WORD wDialogCaps ;
+extern WORD wAdminCaps ;
+extern WORD wSpecVersion;
+extern WORD wDriverVersion;
+
+WORD API WNetGetCaps16(WORD p1) ;
+WORD API WNetGetError16(LPINT p1) ;
+WORD API WNetGetErrorText16(WORD p1, LPSTR p2, LPINT p3) ;
+
+DWORD API GetLastError32(VOID) ;
+
+WORD SetLastError(WORD err) ;
+
+DWORD MapWNType16To32(WORD nType) ;
+WORD MapWin32ErrorToWN16(DWORD err) ;
+WORD GetLanmanDrvEntryPoints(LPFN *lplpfn,
+ LPSTR lpName) ;
+//
+// we define this because the silly compiler chokes if we add yet
+// more to the include path to get to lmerr.h.
+//
+// this is not that bad since the value below will never change.
+//
+
+#define NERR_BASE 2100
+#define NERR_UseNotFound (NERR_BASE+150)
diff --git a/private/mvdm/wow16/wfwnet/makefile b/private/mvdm/wow16/wfwnet/makefile
new file mode 100644
index 000000000..6970c774f
--- /dev/null
+++ b/private/mvdm/wow16/wfwnet/makefile
@@ -0,0 +1,140 @@
+# wfwnet.drv makefile
+#
+# Copyright (c) 1991-1993 Microsoft Corporation
+#
+# History:
+# Created 25-Mar-1993 Chuck Y. Chan (ChuckC)
+#
+
+!IFDEF USEBUILD
+
+# If using BUILD.EXE, edit .\sources. if you want to add a new source
+# file to this component. This file merely indirects to the real make file
+# that is shared by all the components of NT OS/2.
+
+!INCLUDE $(NTMAKEENV)\makefile.def
+
+!ELSE
+
+.SUFFIXES:
+.SUFFIXES: .c .asm .h .inc .obj .lst .sys .exe .com .map .sym .def .lib .dll .res .rc
+
+
+!ifdef INCLUDE
+INCS =
+!else
+INCS = -I. -I..\inc -I..\..\inc -I$(_NTBINDIR)\public\sdk\inc
+!endif
+
+# DEFINES = -DWOW -DDEBUG $(MVDMFLAGS)
+DEFINES = -DWOW $(MVDMFLAGS) -DBUILDDLL
+
+AOBJ = -Ml -t $(DEFINES) $(INCS)
+
+CW16 = -AS -G2sw -Os -W3 -Zp $(DEFINES) $(INCS)
+CW16B = $(CW16) -B1 c1l.exe -B2 c2l.exe -B3 c3l.exe
+
+LINK = /map /align:16
+
+########## Path definition so we find 16 bit tools ##########
+# Also works around stupid bug in RC 3.1 that doesn't allow rcpp.err to be
+# in a directory that is greater than 128 chars down the path, even if
+# rc 3.1 is running as an OS/2 app.
+
+PATH = $(_NTBINDIR)\private\mvdm\tools16;$(PATH)
+
+!if "$(NTDEBUG)"!="" && "$(NTDEBUG)"!="retail" && "$(NTDEBUG)" != "ntsdnodbg"
+AOBJ = $(AOBJ) -Zd
+CW16 = $(CW16) /Od /Oi /Zd
+LINK = $(LINK) /LI
+!endif
+
+W16LIBS = ..\lib\snocrtd.lib
+
+!IF "$(QFE_BUILD)" != "1"
+CL16=cl16
+!ELSE
+CL16=cl
+!ENDIF
+
+
+.asm.obj:
+ masm $(AOBJ) $*;
+
+.asm.lst:
+ masm $(AOBJ) -l $*,nul,$*.lst;
+
+
+.c.obj:
+ $(CL16) -c -nologo $(CW16) $*.c
+
+.c.lst:
+ $(CL16) -c -nologo $(CW16) -Fonul -Fc$*.lst $*.c
+
+
+.def.lib:
+ implib $*.lib $*.def
+
+.map.sym:
+ mapsym $*
+
+.rc.res:
+ rc16 $(INCS) -r $*.rc
+
+
+all: wfwnet.drv wfwnet.sym
+ -binplace wfwnet.drv wfwnet.sym wfwnet.map
+
+clean: cleanup all
+
+cleanup:
+ if exist *.lrf del *.lrf
+ if exist *.obj del *.obj
+ if exist *.exe del *.exe
+ if exist *.dll del *.dll
+ if exist *.map del *.map
+ if exist *.sym del *.sym
+ if exist *.drv del *.drv
+ if exist *.res del *.res
+
+
+wfwnet.obj: wfwnet.c ..\..\inc\wow.inc ..\inc\winnet.h ..\inc\wfwnet.h \
+ .\locals.h .\bseerr.h
+ $(CL16) -c -nologo $(CW16) $*.c
+
+print.obj: print.c ..\..\inc\wow.inc ..\inc\winnet.h ..\inc\wfwnet.h \
+ ..\inc\spl_wnt.h .\locals.h .\bseerr.h
+ $(CL16) -c -nologo $(CW16) $*.c
+
+misc.obj: misc.c ..\..\inc\wow.inc ..\inc\winnet.h ..\inc\wfwnet.h \
+ .\locals.h .\bseerr.h
+ $(CL16) -c -nologo $(CW16) $*.c
+
+to32.obj: to32.c ..\..\inc\wow.inc ..\inc\winnet.h ..\inc\wfwnet.h \
+ .\locals.h .\bseerr.h
+ $(CL16) -c -nologo $(CW16) $*.c
+
+lfn.obj: lfn.c ..\..\inc\wow.inc ..\inc\winnet.h ..\inc\wfwnet.h \
+ .\locals.h .\bseerr.h
+ $(CL16) -c -nologo $(CW16) $*.c
+
+wfwnet.lrf: makefile
+ echo wfwnet.obj+ >wfwnet.lrf
+ echo to32.obj+ >>wfwnet.lrf
+ echo print.obj+ >>wfwnet.lrf
+ echo misc.obj+ >>wfwnet.lrf
+ echo lfn.obj+ >>wfwnet.lrf
+ echo libentry.obj+ >>wfwnet.lrf
+ echo ints.obj >>wfwnet.lrf
+ echo wfwnet.drv>>wfwnet.lrf
+ echo wfwnet $(LINK)>>wfwnet.lrf
+ echo ..\lib\libw.lib /nod>>wfwnet.lrf
+ echo wfwnet;>>wfwnet.lrf
+
+wfwnet.res: $*.rc $*.rcv ..\inc\common.ver
+
+wfwnet.drv: ints.obj libentry.obj wfwnet.obj to32.obj lfn.obj print.obj misc.obj wfwnet.lrf wfwnet.def wfwnet.res
+ link16 @wfwnet.lrf;
+ rc16 -t wfwnet.res wfwnet.drv
+
+!ENDIF
diff --git a/private/mvdm/wow16/wfwnet/misc.c b/private/mvdm/wow16/wfwnet/misc.c
new file mode 100644
index 000000000..def754915
--- /dev/null
+++ b/private/mvdm/wow16/wfwnet/misc.c
@@ -0,0 +1,265 @@
+/*++
+
+Copyright (c) 1989-1993 Microsoft Corporation
+
+Module Name:
+
+ misc.c
+
+Abstract:
+
+ Provides entry points for miscellaneous functions to match the WFW3.1
+ Network provider,
+
+ The majority of the functions are either no longer supported, or
+ call thru to other functions.
+
+Author:
+
+ Chuck Y Chan (ChuckC) 25-Mar-1993
+
+Revision History:
+
+
+--*/
+#include <windows.h>
+#include <locals.h>
+
+
+WORD API WNetExitConfirm(HWND hwndOwner,
+ WORD iExitType)
+{
+ UNREFERENCED(hwndOwner) ;
+ UNREFERENCED(hwndOwner) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+BOOL API I_AutoLogon(HWND hwndOwner,
+ LPSTR lpszReserved,
+ BOOL fPrompt,
+ BOOL FAR *lpfLoggedOn)
+{
+ UNREFERENCED(hwndOwner) ;
+ UNREFERENCED(lpszReserved) ;
+ UNREFERENCED(fPrompt) ;
+ UNREFERENCED(lpfLoggedOn) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ SetLastError(WN_NOT_SUPPORTED) ;
+ return FALSE ;
+}
+
+BOOL API I_Logoff(HWND hwndOwner,
+ LPSTR lpszReserved)
+{
+ UNREFERENCED(hwndOwner) ;
+ UNREFERENCED(lpszReserved) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ SetLastError(WN_NOT_SUPPORTED) ;
+ return FALSE ;
+}
+
+VOID API I_ChangePassword(HWND hwndOwner)
+{
+ UNREFERENCED(hwndOwner) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ SetLastError(WN_NOT_SUPPORTED) ;
+}
+
+VOID API I_ChangeCachePassword(HWND hwndOwner)
+{
+ UNREFERENCED(hwndOwner) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ SetLastError(WN_NOT_SUPPORTED) ;
+}
+
+WORD API I_ConnectDialog(HWND hwndParent,
+ WORD iType)
+{
+ return WNetConnectDialog(hwndParent, iType) ;
+}
+
+WORD API I_ConnectionDialog(HWND hwndParent,
+ WORD iType)
+{
+ return WNetConnectDialog(hwndParent, iType) ;
+}
+
+WORD API WNetCachePassword(LPSTR pbResource,
+ WORD cbResource,
+ LPSTR pbPassword,
+ WORD cbPassword,
+ BYTE nType)
+{
+ UNREFERENCED(pbResource) ;
+ UNREFERENCED(cbResource) ;
+ UNREFERENCED(pbPassword) ;
+ UNREFERENCED(cbPassword) ;
+ UNREFERENCED(nType) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API WNetGetCachedPassword(LPSTR pbResource,
+ WORD cbResource,
+ LPSTR pbPassword,
+ LPWORD pcbPassword,
+ BYTE nType)
+{
+ UNREFERENCED(pbResource) ;
+ UNREFERENCED(cbResource) ;
+ UNREFERENCED(pbPassword) ;
+ UNREFERENCED(pcbPassword) ;
+ UNREFERENCED(nType) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+
+WORD API WNetRemoveCachedPassword(LPSTR pbResource,
+ WORD cbResource,
+ BYTE nType)
+{
+ UNREFERENCED(pbResource) ;
+ UNREFERENCED(cbResource) ;
+ UNREFERENCED(nType) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API WNetEnumCachedPasswords(LPSTR pbPrefix,
+ WORD cbPrefix,
+ BYTE nType,
+ CACHECALLBACK pfnCallback)
+{
+ UNREFERENCED(pbPrefix) ;
+ UNREFERENCED(cbPrefix) ;
+ UNREFERENCED(nType) ;
+ UNREFERENCED(pfnCallback) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API WNetSharesDialog(HWND hwndParent,
+ WORD iType)
+{
+ UNREFERENCED(hwndParent) ;
+ UNREFERENCED(iType) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API WNetSetDefaultDrive(WORD idriveDefault)
+{
+ UNREFERENCED(idriveDefault) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API WNetGetShareCount(WORD iType)
+{
+ UNREFERENCED(iType) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API WNetGetShareName(LPSTR lpszPath,
+ LPSTR lpszBuf,
+ WORD cbBuf)
+{
+ UNREFERENCED(lpszPath) ;
+ UNREFERENCED(lpszBuf) ;
+ UNREFERENCED(cbBuf) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API WNetGetSharePath(LPSTR lpszName,
+ LPSTR lpszBuf,
+ WORD cbBuf)
+{
+ UNREFERENCED(lpszName) ;
+ UNREFERENCED(lpszBuf) ;
+ UNREFERENCED(cbBuf) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API WNetGetLastConnection(WORD iType,
+ LPWORD lpwConnIndex)
+{
+ UNREFERENCED(iType) ;
+ UNREFERENCED(lpwConnIndex) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WORD API WNetGetError(LPINT p1)
+{
+ WORD err ;
+ WORD wLastErr ;
+
+ /*
+ * fake the last error capabilty. if last thing we talked to was Win32,
+ * the get the information from 32 bit system. ditto if it was a Win16
+ * call.
+ */
+ if (vLastCall == LAST_CALL_IS_WIN32)
+ {
+ err = (WORD) GetLastError32() ;
+ return err ;
+ }
+ else if (vLastCall == LAST_CALL_IS_LANMAN_DRV)
+ {
+ err = WNetGetError16(&wLastErr) ;
+ if (err != WN_SUCCESS)
+ return err ;
+ else
+ return wLastErr ;
+ }
+ else
+ {
+ return(vLastError) ;
+ }
+}
+
+WORD API WNetGetErrorText(WORD p1,LPSTR p2,LPINT p3)
+{
+ if (vLastCall == LAST_CALL_IS_WIN32)
+ {
+ *p2 = 0 ;
+ *p3 = 0 ;
+ return WN_NOT_SUPPORTED ;
+ }
+ else // use whatever lanman.drv gives us
+ {
+ return (WNetGetErrorText16(p1, p2, p3)) ;
+ }
+}
+
+WORD API WNetErrorText(WORD p1,LPSTR p2,WORD p3)
+{
+ WORD cbBuffer = p3 ;
+
+ return (WNetGetErrorText(p1, p2, &cbBuffer) == 0) ;
+}
+
+/*
+ * misc startup/shutdown routines. nothing interesting
+ */
+
+VOID FAR PASCAL Enable(VOID)
+{
+ return ;
+}
+
+VOID FAR PASCAL Disable(VOID)
+{
+ return ;
+}
+
+int far pascal WEP()
+{
+ return 0 ;
+}
+
diff --git a/private/mvdm/wow16/wfwnet/print.c b/private/mvdm/wow16/wfwnet/print.c
new file mode 100644
index 000000000..44efe5b15
--- /dev/null
+++ b/private/mvdm/wow16/wfwnet/print.c
@@ -0,0 +1,132 @@
+/*++
+
+Copyright (c) 1989-1993 Microsoft Corporation
+
+Module Name:
+
+ print.c
+
+Abstract:
+
+ Provides entry points for the Print Functions from Win3.1
+ Network provider design.
+
+ All functions are obsolete. They either return WN_NOT_SUPPORTED
+ or FALSE.
+
+Author:
+
+ Chuck Y Chan (ChuckC) 25-Mar-1993
+
+Revision History:
+
+
+--*/
+#include <windows.h>
+#include <locals.h>
+
+
+void API WNetPrintMgrSelNotify (BYTE p1,
+ LPQS2 p2,
+ LPQS2 p3,
+ LPJOBSTRUCT2 p4,
+ LPJOBSTRUCT2 p5,
+ LPWORD p6,
+ LPSTR p7,
+ WORD p8)
+{
+ UNREFERENCED(p1) ;
+ UNREFERENCED(p2) ;
+ UNREFERENCED(p3) ;
+ UNREFERENCED(p4) ;
+ UNREFERENCED(p5) ;
+ UNREFERENCED(p6) ;
+ UNREFERENCED(p7) ;
+ UNREFERENCED(p8) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ SetLastError(WN_NOT_SUPPORTED) ;
+ return ;
+}
+
+WNETERR API WNetPrintMgrPrinterEnum (LPSTR lpszQueueName,
+ LPSTR lpBuffer,
+ LPWORD pcbBuffer,
+ LPWORD cAvail,
+ WORD usLevel)
+{
+ UNREFERENCED(lpszQueueName) ;
+ UNREFERENCED(lpBuffer) ;
+ UNREFERENCED(pcbBuffer) ;
+ UNREFERENCED(cAvail) ;
+ UNREFERENCED(usLevel) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WNETERR API WNetPrintMgrChangeMenus(HWND p1,
+ HANDLE FAR *p2,
+ BOOL FAR *p3)
+{
+ UNREFERENCED(p1) ;
+ UNREFERENCED(p2) ;
+ UNREFERENCED(p3) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+WNETERR API WNetPrintMgrCommand (HWND p1,
+ WORD p2)
+{
+ UNREFERENCED(p1) ;
+ UNREFERENCED(p2) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ return (SetLastError(WN_NOT_SUPPORTED)) ;
+}
+
+void API WNetPrintMgrExiting (void)
+{
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ SetLastError(WN_NOT_SUPPORTED) ;
+ return ;
+}
+
+BOOL API WNetPrintMgrExtHelp (DWORD p1)
+{
+ UNREFERENCED(p1) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ SetLastError(WN_NOT_SUPPORTED) ;
+ return FALSE ;
+}
+
+WORD API WNetPrintMgrMoveJob (HWND p1,
+ LPSTR p2,
+ WORD p3,
+ int p4)
+{
+ UNREFERENCED(p1) ;
+ UNREFERENCED(p2) ;
+ UNREFERENCED(p3) ;
+ UNREFERENCED(p4) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ SetLastError(WN_NOT_SUPPORTED) ;
+ return 0 ;
+}
+
+void API WNetPrintMgrStatusChange (LPSTR lpszQueueName,
+ LPSTR lpszPortName,
+ WORD wQueueStatus,
+ WORD cJobsLeft,
+ HANDLE hJCB,
+ BOOL fDeleted)
+{
+ UNREFERENCED(lpszQueueName) ;
+ UNREFERENCED(lpszPortName) ;
+ UNREFERENCED(wQueueStatus) ;
+ UNREFERENCED(cJobsLeft) ;
+ UNREFERENCED(hJCB) ;
+ UNREFERENCED(fDeleted) ;
+ vLastCall = LAST_CALL_IS_LOCAL ;
+ SetLastError(WN_NOT_SUPPORTED) ;
+ return ;
+}
+
diff --git a/private/mvdm/wow16/wfwnet/to32.c b/private/mvdm/wow16/wfwnet/to32.c
new file mode 100644
index 000000000..8192fc2de
--- /dev/null
+++ b/private/mvdm/wow16/wfwnet/to32.c
@@ -0,0 +1,1268 @@
+/*++
+
+Copyright (c) 1989-1993 Microsoft Corporation
+
+Module Name:
+
+ to32.c
+
+Abstract:
+
+ Provides entry points for the Functions from WFW3.1
+ Network provider design which are niw thunked to some
+ 32 bit equivalent.
+
+Author:
+
+ Chuck Y Chan (ChuckC) 25-Mar-1993
+
+Revision History:
+
+
+--*/
+#include <windows.h>
+#include <locals.h>
+
+//
+// addresses to 32 bit entry points. note these cannot be
+// called directly. CallProc32W must be used,
+//
+LPVOID lpfnWNetAddConnection = NULL ;
+LPVOID lpfnWNetCancelConnection = NULL ;
+LPVOID lpfnWNetGetConnection = NULL ;
+LPVOID lpfnWNetRestoreConnection = NULL ;
+LPVOID lpfnWNetGetUser = NULL ;
+LPVOID lpfnWNetBrowseDialog = NULL ;
+LPVOID lpfnWNetConnectDialog = NULL ;
+LPVOID lpfnWNetDisconnectDialog = NULL ;
+LPVOID lpfnWNetConnectionDialog = NULL ;
+LPVOID lpfnWNetPropertyDialog = NULL ;
+LPVOID lpfnWNetGetPropertyText = NULL ;
+LPVOID lpfnWNetShareAsDialog = NULL ;
+LPVOID lpfnWNetStopShareDialog = NULL ;
+LPVOID lpfnWNetServerBrowseDialog = NULL ;
+LPVOID lpfnWNetGetDirectoryType = NULL ;
+LPVOID lpfnWNetDirectoryNotify = NULL ;
+LPVOID lpfnGetLastError32 = NULL ;
+LPVOID lpfnClosePrinter = NULL ;
+LPVOID lpfnConnectToPrinter = NULL ;
+
+//
+// forward declare
+//
+WORD Get32BitEntryPoints( LPVOID *lplpfn, DWORD dwDll, LPSTR lpProcName ) ;
+WORD API PrintConnectDialog(HWND p1) ;
+WORD GetAlignedMemory(LPVOID FAR *pAligned, HANDLE FAR *pHandle, WORD wSize) ;
+void FreeAlignedMemory(HANDLE handle) ;
+
+//
+// WNetAddConnection thunk to Win32
+//
+UINT API WNetAddConnection(LPSTR p1,LPSTR p2,LPSTR p3)
+{
+ WORD err ;
+ LPSTR aligned_p1 = NULL, aligned_p2 = NULL, aligned_p3 = NULL ;
+ HANDLE handle_p1 = NULL, handle_p2 = NULL, handle_p3 = NULL;
+
+ if (p1 == NULL || p3 == NULL)
+ return WN_BAD_POINTER ;
+
+ if (p2 && (*p2 == '\0'))
+ p2 = NULL ;
+
+ if (!lpfnWNetAddConnection)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnWNetAddConnection,
+ USE_MPR_DLL,
+ "WNetAddConnectionA" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // make copy of parameters so that we are aligned (p1 & p3 wont be NULL)
+ //
+ if (err = GetAlignedMemory(&aligned_p1, &handle_p1, lstrlen(p1)+1))
+ goto ExitPoint ;
+ lstrcpy(aligned_p1, p1) ;
+
+ if (err = GetAlignedMemory(&aligned_p3, &handle_p3, lstrlen(p3)+1))
+ goto ExitPoint ;
+ lstrcpy(aligned_p3, p3) ;
+
+ if (p2)
+ {
+ if (err = GetAlignedMemory(&aligned_p2, &handle_p2, lstrlen(p2)+1))
+ goto ExitPoint ;
+ lstrcpy(aligned_p2, p2) ;
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ err = MapWin32ErrorToWN16( CallProc32W(aligned_p1,
+ (DWORD)aligned_p2,
+ (DWORD)aligned_p3,
+ lpfnWNetAddConnection,
+ (DWORD)7,
+ (DWORD)3) ) ;
+ExitPoint:
+
+ FreeAlignedMemory(handle_p1) ;
+ FreeAlignedMemory(handle_p2) ;
+ FreeAlignedMemory(handle_p3) ;
+ return err ;
+}
+
+
+//
+// WNetCancelConnection thunk to Win32
+//
+UINT API WNetCancelConnection(LPSTR p1,BOOL p2)
+{
+ WORD err ;
+ LPSTR aligned_p1 = NULL ;
+ HANDLE handle_p1 = NULL ;
+
+ if (p1 == NULL)
+ return WN_BAD_POINTER ;
+
+ if (!lpfnWNetCancelConnection)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnWNetCancelConnection,
+ USE_MPR_DLL,
+ "WNetCancelConnectionA" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // make copy of parameters so that we are aligned
+ //
+ if (err = GetAlignedMemory(&aligned_p1, &handle_p1, lstrlen(p1)+1))
+ goto ExitPoint ;
+ lstrcpy(aligned_p1, p1) ;
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ err = MapWin32ErrorToWN16( CallProc32W(aligned_p1,
+ (DWORD)p2,
+ (DWORD)lpfnWNetCancelConnection,
+ (DWORD)2,
+ (DWORD)2) ) ;
+ExitPoint:
+
+ FreeAlignedMemory(handle_p1) ;
+ return err ;
+}
+
+//
+// WNetGetConnection thunk to Win32
+//
+UINT API WNetGetConnection(LPSTR p1,LPSTR p2, UINT FAR *p3)
+{
+ WORD err ;
+ LPSTR aligned_p1 = NULL, aligned_p2 = NULL ;
+ LPDWORD aligned_p3 = NULL ;
+ HANDLE handle_p1 = NULL, handle_p2 = NULL, handle_p3 = NULL;
+
+ if (p1 == NULL || p2 == NULL || p3 == NULL)
+ return WN_BAD_POINTER ;
+
+ if (!lpfnWNetGetConnection)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnWNetGetConnection,
+ USE_MPR_DLL,
+ "WNetGetConnectionA" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // make copy of parameters so that we are aligned
+ //
+ if (err = GetAlignedMemory(&aligned_p1, &handle_p1, lstrlen(p1)+1))
+ goto ExitPoint ;
+ lstrcpy(aligned_p1, p1) ;
+
+ if (err = GetAlignedMemory(&aligned_p2, &handle_p2, *p3 ? *p3 : 1))
+ goto ExitPoint ;
+
+ if (err = GetAlignedMemory(&aligned_p3, &handle_p3, sizeof(DWORD)))
+ goto ExitPoint ;
+ *aligned_p3 = *p3 ;
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ err = MapWin32ErrorToWN16( CallProc32W(aligned_p1,
+ (DWORD)aligned_p2,
+ (DWORD)aligned_p3,
+ lpfnWNetGetConnection,
+ (DWORD)7,
+ (DWORD)3) ) ;
+ lstrcpy(p2, aligned_p2) ;
+
+ if (err == WN_SUCCESS)
+ *p3 = lstrlen(p2) ;
+ else
+ *p3 = (UINT)*aligned_p3 ;
+
+ExitPoint:
+
+ FreeAlignedMemory(handle_p1) ;
+ FreeAlignedMemory(handle_p2) ;
+ FreeAlignedMemory(handle_p3) ;
+ return err ;
+}
+
+UINT API WNetRestoreConnection(HWND p1,LPSTR p2)
+{
+ WORD err ;
+ LPSTR aligned_p2 = NULL ;
+ HANDLE handle_p2 = NULL ;
+
+ if (p2 == NULL)
+ return WN_BAD_POINTER ;
+
+ if (!lpfnWNetRestoreConnection)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnWNetRestoreConnection,
+ USE_MPRUI_DLL,
+ "WNetRestoreConnectionA" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // guard against this weird case from Win3.0 days where -1
+ // means something special. NULL is close approximation -> ie all.
+ //
+ if (p2 == (LPSTR)-1)
+ p2 = NULL ;
+
+ if (p2)
+ {
+ if (err = GetAlignedMemory(&aligned_p2, &handle_p2, lstrlen(p2)+1))
+ goto ExitPoint ;
+ lstrcpy(aligned_p2, p2) ;
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ err = MapWin32ErrorToWN16( CallProc32W((LPVOID)TO_HWND32(p1),
+ (DWORD)aligned_p2,
+ (DWORD)lpfnWNetRestoreConnection,
+ (DWORD)1,
+ (DWORD)2) ) ;
+
+ExitPoint:
+
+ FreeAlignedMemory(handle_p2) ;
+ return err ;
+}
+
+WORD API WNetGetUser(LPSTR p1,LPINT p2)
+{
+ WORD err ;
+ LONG lTmp = *p2 ;
+ LPSTR aligned_p1 = NULL ;
+ LPINT aligned_p2 = NULL ;
+ HANDLE handle_p1 = NULL, handle_p2 = NULL ;
+
+ if (p1 == NULL || p2 == NULL)
+ return WN_BAD_POINTER ;
+
+ if (!lpfnWNetGetUser)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnWNetGetUser,
+ USE_MPR_DLL,
+ "WNetGetUserA" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ if (err = GetAlignedMemory(&aligned_p1, &handle_p1, *p2))
+ goto ExitPoint ;
+
+ if (err = GetAlignedMemory(&aligned_p2, &handle_p2, sizeof(DWORD)))
+ goto ExitPoint ;
+ *aligned_p2 = *p2 ;
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ err = MapWin32ErrorToWN16( CallProc32W(NULL,
+ (DWORD)aligned_p1,
+ (DWORD)aligned_p2,
+ lpfnWNetGetUser,
+ (DWORD)7,
+ (DWORD)3) );
+ *p2 = (int) *aligned_p2 ;
+ lstrcpy(p1, aligned_p1) ;
+
+ExitPoint:
+
+ FreeAlignedMemory(handle_p1) ;
+ FreeAlignedMemory(handle_p2) ;
+ return err ;
+}
+
+WORD API WNetBrowseDialog(HWND p1,WORD p2,LPSTR p3)
+{
+ WORD err ;
+ DWORD dwErr ;
+ LPSTR aligned_p3 = NULL ;
+ HANDLE handle_p3 = NULL ;
+
+ if (p3 == NULL)
+ return WN_BAD_POINTER ;
+
+ if (!lpfnWNetBrowseDialog)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnWNetBrowseDialog,
+ USE_MPRUI_DLL,
+ "BrowseDialogA0" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note that the WFW API does not let user specify buffer size.
+ // we have a tmp buffer, and then copy over. this takes care
+ // data alignment, also make sure we dont fault on 32 bit side.
+ //
+ // the 128 is consistent with what their docs specs the buffer
+ // size should be.
+ //
+ if (err = GetAlignedMemory(&aligned_p3, &handle_p3, 128))
+ goto ExitPoint ;
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ dwErr = CallProc32W((LPVOID)TO_HWND32(p1),
+ (DWORD)MapWNType16To32(p2),
+ (DWORD)aligned_p3,
+ (DWORD)128,
+ lpfnWNetBrowseDialog,
+ (DWORD)2,
+ (DWORD)4) ;
+ if (dwErr == 0xFFFFFFFF)
+ err = WN_CANCEL ;
+ else
+ err = MapWin32ErrorToWN16( dwErr ) ;
+
+ if (!err)
+ lstrcpy(p3,aligned_p3) ;
+
+ExitPoint:
+
+ FreeAlignedMemory(handle_p3) ;
+ return err ;
+}
+
+WORD API WNetConnectDialog(HWND p1,WORD p2)
+{
+ WORD err ;
+ DWORD dwErr ;
+
+ if (p2 == WNTYPE_PRINTER)
+ {
+ err = PrintConnectDialog(p1) ;
+ return err ;
+ }
+
+ if (!lpfnWNetConnectDialog)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnWNetConnectDialog,
+ USE_MPR_DLL,
+ "WNetConnectionDialog" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ dwErr = CallProc32W( (LPVOID)TO_HWND32(p1),
+ (DWORD)MapWNType16To32(p2),
+ (DWORD)lpfnWNetConnectDialog,
+ (DWORD) 0,
+ (DWORD) 2 ) ;
+ if (dwErr == 0xFFFFFFFF)
+ err = WN_CANCEL ;
+ else
+ err = MapWin32ErrorToWN16( dwErr ) ;
+ return err ;
+}
+
+
+WORD API WNetDisconnectDialog(HWND p1,WORD p2)
+{
+ WORD err ;
+ DWORD dwErr ;
+
+ if (!lpfnWNetDisconnectDialog)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnWNetDisconnectDialog,
+ USE_MPR_DLL,
+ "WNetDisconnectDialog" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ dwErr = CallProc32W( (LPVOID)TO_HWND32(p1),
+ (DWORD)MapWNType16To32(p2),
+ (DWORD)lpfnWNetDisconnectDialog,
+ (DWORD) 0,
+ (DWORD) 2 ) ;
+ if (dwErr == 0xFFFFFFFF)
+ err = WN_CANCEL ;
+ else
+ err = MapWin32ErrorToWN16( dwErr ) ;
+ return err ;
+}
+
+WORD API WNetConnectionDialog(HWND p1,WORD p2)
+{
+ return (WNetConnectDialog(p1,p2)) ;
+}
+
+WORD API PrintConnectDialog(HWND p1)
+{
+ WORD err ;
+ DWORD dwErr ;
+ DWORD handle ;
+
+ if (!lpfnClosePrinter)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnClosePrinter,
+ USE_WINSPOOL_DRV,
+ "ClosePrinter" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ if (!lpfnConnectToPrinter)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnConnectToPrinter,
+ USE_WINSPOOL_DRV,
+ "ConnectToPrinterDlg" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ err = WN_SUCCESS ;
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ handle = CallProc32W( (LPVOID)TO_HWND32(p1),
+ (DWORD) 0,
+ (DWORD)lpfnConnectToPrinter,
+ (DWORD) 0,
+ (DWORD) 2 ) ;
+ if (handle == 0)
+ err = WN_CANCEL ; // most likely reason
+ else
+ {
+ dwErr = MapWin32ErrorToWN16( CallProc32W((LPVOID)handle,
+ (DWORD)lpfnClosePrinter,
+ (DWORD)0,
+ (DWORD)1) );
+ // but ignore the error
+ }
+ return err ;
+}
+
+WORD API WNetPropertyDialog(HWND hwndParent,
+ WORD iButton,
+ WORD nPropSel,
+ LPSTR lpszName,
+ WORD nType)
+{
+ WORD err ;
+ LPSTR aligned_name = NULL ;
+ HANDLE handle_name = NULL ;
+
+ if (!lpfnWNetPropertyDialog)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnWNetPropertyDialog,
+ USE_MPR_DLL,
+ "WNetPropertyDialogA" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ if (lpszName)
+ {
+ if (err = GetAlignedMemory(&aligned_name,
+ &handle_name,
+ lstrlen(lpszName)+1))
+ goto ExitPoint ;
+ lstrcpy(aligned_name, lpszName) ;
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ err = MapWin32ErrorToWN16( CallProc32W( (LPVOID)TO_HWND32(hwndParent),
+ (DWORD) iButton,
+ (DWORD) nPropSel,
+ (DWORD) aligned_name,
+ (DWORD) nType,
+ lpfnWNetPropertyDialog,
+ (DWORD)2,
+ (DWORD)5) ) ;
+ExitPoint:
+
+ FreeAlignedMemory(handle_name) ;
+ return err ;
+}
+
+WORD API WNetGetPropertyText(WORD iButton,
+ WORD nPropSel,
+ LPSTR lpszName,
+ LPSTR lpszButtonName,
+ WORD cbButtonName,
+ WORD nType)
+{
+ WORD err ;
+ LPSTR aligned_name = NULL, aligned_button_name = NULL ;
+ HANDLE handle_name = NULL, handle_button_name = NULL ;
+
+ if (lpszButtonName == NULL)
+ return WN_BAD_POINTER ;
+
+ if (!lpfnWNetGetPropertyText)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnWNetGetPropertyText,
+ USE_MPR_DLL,
+ "WNetGetPropertyTextA" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ if (lpszName)
+ {
+ if (err = GetAlignedMemory(&aligned_name,
+ &handle_name,
+ lstrlen(lpszName)+1))
+ goto ExitPoint ;
+ lstrcpy(aligned_name, lpszName) ;
+ }
+
+ if (err = GetAlignedMemory(&aligned_button_name,
+ &handle_button_name,
+ cbButtonName))
+ goto ExitPoint ;
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ err = MapWin32ErrorToWN16( CallProc32W( (LPVOID)iButton,
+ (DWORD) nPropSel,
+ (DWORD) aligned_name,
+ (DWORD) aligned_button_name,
+ (DWORD) cbButtonName,
+ (DWORD) nType,
+ lpfnWNetGetPropertyText,
+ (DWORD)12,
+ (DWORD)6) ) ;
+ if (err == WN_SUCCESS)
+ lstrcpy(lpszButtonName, aligned_button_name) ;
+
+ExitPoint:
+
+ FreeAlignedMemory(handle_name) ;
+ FreeAlignedMemory(handle_button_name) ;
+ return err ;
+}
+
+WORD API WNetShareAsDialog(HWND hwndParent,
+ WORD iType,
+ LPSTR lpszPath)
+{
+ WORD err ;
+ LPSTR aligned_path = NULL ;
+ HANDLE handle_path = NULL ;
+
+ if (!lpfnWNetShareAsDialog)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnWNetShareAsDialog,
+ USE_NTLANMAN_DLL,
+ "ShareAsDialogA0" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ if (lpszPath)
+ {
+ if (err = GetAlignedMemory(&aligned_path,
+ &handle_path,
+ lstrlen(lpszPath)+1))
+ goto ExitPoint ;
+ lstrcpy(aligned_path, lpszPath) ;
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ err = MapWin32ErrorToWN16( CallProc32W( (LPVOID)TO_HWND32(hwndParent),
+ (DWORD) MapWNType16To32(iType),
+ (DWORD) aligned_path,
+ lpfnWNetShareAsDialog,
+ (DWORD)1,
+ (DWORD)3) ) ;
+ExitPoint:
+
+ FreeAlignedMemory(handle_path) ;
+ return err ;
+}
+
+WORD API WNetStopShareDialog(HWND hwndParent,
+ WORD iType,
+ LPSTR lpszPath)
+{
+ WORD err ;
+ LPSTR aligned_path = NULL ;
+ HANDLE handle_path = NULL ;
+
+ if (!lpfnWNetStopShareDialog)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnWNetStopShareDialog,
+ USE_NTLANMAN_DLL,
+ "StopShareDialogA0" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ if (lpszPath)
+ {
+ if (err = GetAlignedMemory(&aligned_path,
+ &handle_path,
+ lstrlen(lpszPath)+1))
+ goto ExitPoint ;
+ lstrcpy(aligned_path, lpszPath) ;
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ err = MapWin32ErrorToWN16( CallProc32W( (LPVOID)TO_HWND32(hwndParent),
+ (DWORD) MapWNType16To32(iType),
+ (DWORD) aligned_path,
+ lpfnWNetStopShareDialog,
+ (DWORD)1,
+ (DWORD)3) ) ;
+ExitPoint:
+
+ FreeAlignedMemory(handle_path) ;
+ return err ;
+}
+
+WORD API WNetServerBrowseDialog(HWND hwndParent,
+ LPSTR lpszSectionName,
+ LPSTR lpszBuffer,
+ WORD cbBuffer,
+ DWORD flFlags)
+{
+ WORD err ;
+ LPSTR aligned_buffer = NULL ;
+ HANDLE handle_buffer = NULL ;
+
+ UNREFERENCED(lpszSectionName) ;
+ UNREFERENCED(flFlags) ;
+
+ if (!lpfnWNetServerBrowseDialog)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnWNetServerBrowseDialog,
+ USE_NTLANMAN_DLL,
+ "ServerBrowseDialogA0" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ if (lpszBuffer)
+ {
+ if (err = GetAlignedMemory(&aligned_buffer, &handle_buffer, cbBuffer))
+ goto ExitPoint ;
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ err = MapWin32ErrorToWN16( CallProc32W( (LPVOID)TO_HWND32(hwndParent),
+ (DWORD) aligned_buffer,
+ (DWORD) cbBuffer,
+ lpfnWNetServerBrowseDialog,
+ (DWORD)2,
+ (DWORD)3) ) ;
+ if (err == WN_SUCCESS)
+ lstrcpy(lpszBuffer, aligned_buffer) ;
+
+ExitPoint:
+
+ FreeAlignedMemory(handle_buffer) ;
+ return err ;
+}
+
+WORD API WNetGetDirectoryType(LPSTR p1,LPINT p2)
+{
+ WORD err ;
+ LPSTR aligned_p1 = NULL ;
+ LPDWORD aligned_p2 = NULL ;
+ HANDLE handle_p1 = NULL, handle_p2 = NULL ;
+
+ if (p1 == NULL || p2 == NULL)
+ return WN_BAD_POINTER ;
+
+ if (!lpfnWNetGetDirectoryType)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnWNetGetDirectoryType,
+ USE_MPR_DLL,
+ "WNetGetDirectoryTypeA" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ if (err = GetAlignedMemory(&aligned_p1, &handle_p1, lstrlen(p1)+1))
+ goto ExitPoint ;
+ lstrcpy(aligned_p1, p1) ;
+
+ if (err = GetAlignedMemory(&aligned_p2, &handle_p2, sizeof(DWORD)))
+ goto ExitPoint ;
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ err = MapWin32ErrorToWN16( CallProc32W(aligned_p1,
+ (DWORD)aligned_p2,
+ (DWORD)TRUE,
+ lpfnWNetGetDirectoryType,
+ (DWORD)6,
+ (DWORD)3) ) ;
+ *p2 = (int) *aligned_p2 ;
+
+ExitPoint:
+
+ FreeAlignedMemory(handle_p1) ;
+ FreeAlignedMemory(handle_p2) ;
+ return err ;
+}
+
+WORD API WNetDirectoryNotify(HWND p1,LPSTR p2,WORD p3)
+{
+ UNREFERENCED(p1) ;
+ UNREFERENCED(p2) ;
+ UNREFERENCED(p3) ;
+ return WN_SUCCESS ;
+}
+
+DWORD API GetLastError32(VOID)
+{
+ WORD err ;
+ DWORD dwErr ;
+
+ if (!lpfnGetLastError32)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from 32 bit side
+ //
+ err = Get32BitEntryPoints( &lpfnGetLastError32,
+ USE_KERNEL32_DLL,
+ "GetLastError" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_WIN32 ;
+ dwErr = (UINT) CallProc32W((LPVOID)lpfnGetLastError32,
+ (DWORD)0,
+ (DWORD)0) ;
+ return (MapWin32ErrorToWN16(dwErr)) ;
+}
+
+/*
+ * Misc support routines
+ */
+
+/*******************************************************************
+
+ NAME: Get32BitEntryPoints
+
+ SYNOPSIS: Get the address of a 32 bit entry point that can
+ then be passed to CallProv32W. Will load the library
+ if it has not already been loaded.
+
+ ENTRY: lplpfn - used to return the address
+ dwDll - which dll to use (see locals.h defintions)
+ lpProcName - proc to load
+
+ EXIT:
+
+ RETURNS: error code
+
+ NOTES:
+
+ HISTORY:
+ ChuckC 25-Mar-93 Created
+
+********************************************************************/
+WORD Get32BitEntryPoints( LPVOID *lplpfn, DWORD dwDll, LPSTR lpProcName )
+{
+ static DWORD hmodKernel32 = NULL ;
+ static DWORD hmodNTLanman = NULL ;
+ static DWORD hmodMpr = NULL ;
+ static DWORD hmodMprUI = NULL ;
+ static DWORD hmodWinSpool = NULL ;
+ DWORD hmod = NULL ;
+
+ //
+ // if we havent loaded it appropriate DLL, load it now
+ //
+ switch (dwDll)
+ {
+ case USE_MPR_DLL:
+ if (hmodMpr == NULL)
+ {
+ hmodMpr = LoadLibraryEx32W(MPR_DLL, NULL, 0) ;
+ if (hmodMpr == NULL)
+ return WN_NOT_SUPPORTED ;
+ }
+ hmod = hmodMpr ;
+ break ;
+
+ case USE_MPRUI_DLL:
+ if (hmodMprUI == NULL)
+ {
+ hmodMprUI = LoadLibraryEx32W(MPRUI_DLL, NULL, 0) ;
+ if (hmodMprUI == NULL)
+ return WN_NOT_SUPPORTED ;
+ }
+ hmod = hmodMprUI ;
+ break ;
+
+ case USE_NTLANMAN_DLL:
+ if (hmodNTLanman == NULL)
+ {
+ hmodNTLanman = LoadLibraryEx32W(NTLANMAN_DLL, NULL, 0) ;
+ if (hmodNTLanman == NULL)
+ return WN_NOT_SUPPORTED ;
+ }
+ hmod = hmodNTLanman ;
+ break ;
+
+ case USE_KERNEL32_DLL:
+ if (hmodKernel32 == NULL)
+ {
+ hmodKernel32 = LoadLibraryEx32W(KERNEL32_DLL, NULL, 0) ;
+ if (hmodKernel32 == NULL)
+ return WN_NOT_SUPPORTED ;
+ }
+ hmod = hmodKernel32 ;
+ break ;
+
+ case USE_WINSPOOL_DRV:
+ if (hmodWinSpool == NULL)
+ {
+ hmodWinSpool = LoadLibraryEx32W(WINSPOOL_DRV, NULL, 0) ;
+ if (hmodWinSpool == NULL)
+ return WN_NOT_SUPPORTED ;
+ }
+ hmod = hmodWinSpool ;
+ break ;
+
+ default:
+ return ERROR_GEN_FAILURE ;
+ }
+
+ //
+ // get the procedure
+ //
+ *lplpfn = (LPVOID) GetProcAddress32W(hmod, lpProcName) ;
+ if (! *lplpfn )
+ return WN_NOT_SUPPORTED ;
+
+ return WN_SUCCESS ;
+}
+
+/*******************************************************************
+
+ NAME: MapWNType16To32
+
+ SYNOPSIS: map the 16 WNet types for DISK/PRINT, etc
+ to their 32 bit equivalents
+
+ ENTRY: nType - 16 bit type
+
+ EXIT:
+
+ RETURNS: the 32 bit type
+
+ NOTES:
+
+ HISTORY:
+ ChuckC 25-Mar-93 Created
+
+********************************************************************/
+DWORD MapWNType16To32(WORD nType)
+{
+ switch (nType)
+ {
+ case WNTYPE_DRIVE :
+ case WNTYPE_FILE :
+ return RESOURCETYPE_DISK ;
+ case WNTYPE_PRINTER :
+ return RESOURCETYPE_PRINT ;
+ case WNTYPE_COMM :
+ default :
+ return RESOURCETYPE_ERROR ;
+ }
+}
+
+/*******************************************************************
+
+ NAME: MapWin32ErrorToWN16
+
+ SYNOPSIS: maps a Win 32 error the old style WN_ 16 bit error.
+
+ ENTRY: err - Win32 error
+
+ EXIT:
+
+ RETURNS: Win 16 error
+
+ NOTES:
+
+ HISTORY:
+ ChuckC 25-Mar-93 Created
+
+********************************************************************/
+WORD MapWin32ErrorToWN16(DWORD err)
+{
+ switch (err)
+ {
+ case ERROR_NOT_SUPPORTED:
+ return WN_NOT_SUPPORTED ;
+
+ case WIN32_WN_CANCEL:
+ return WN_CANCEL ;
+
+ case WIN32_EXTENDED_ERROR :
+ case ERROR_UNEXP_NET_ERR:
+ return WN_NET_ERROR ;
+
+ case ERROR_MORE_DATA:
+ return WN_MORE_DATA ;
+
+ case ERROR_INVALID_PARAMETER:
+ return WN_BAD_VALUE ;
+
+ case ERROR_INVALID_PASSWORD:
+ return WN_BAD_PASSWORD ;
+
+ case ERROR_ACCESS_DENIED:
+ return WN_ACCESS_DENIED ;
+
+ case ERROR_NETWORK_BUSY:
+ return WN_FUNCTION_BUSY ;
+
+ case ERROR_NOT_ENOUGH_MEMORY:
+ return WN_OUT_OF_MEMORY ;
+
+ case ERROR_BAD_NET_NAME:
+ case ERROR_BAD_NETPATH:
+ return WN_BAD_NETNAME ;
+
+ case ERROR_INVALID_DRIVE:
+ return WN_BAD_LOCALNAME ;
+
+ case ERROR_ALREADY_ASSIGNED:
+ return WN_ALREADY_CONNECTED ;
+
+ case ERROR_GEN_FAILURE:
+ return WN_DEVICE_ERROR ;
+
+ case NERR_UseNotFound:
+ return WN_NOT_CONNECTED ;
+
+ default:
+ return ( (WORD) err ) ;
+ }
+}
+
+/*******************************************************************
+
+ NAME: GetAlignedMemory
+
+ SYNOPSIS: global alloc some mem to make sure we have DWORD
+ aligned data. non x86 platforms may need this.
+
+ ENTRY: pAligned : used to return pointer to aligned memory allocated
+ pHandle : used to return handle of aligned memory allocated
+ wSize : bytes required
+
+ EXIT:
+
+ RETURNS: WN_SUCCESS or WN_OUT_OF_MEMORY
+
+ NOTES:
+
+ HISTORY:
+ ChuckC 27-Feb-94 Created
+
+********************************************************************/
+WORD GetAlignedMemory(LPVOID FAR *pAligned, HANDLE FAR *pHandle, WORD wSize)
+{
+ *pAligned = NULL ;
+ *pHandle = NULL ;
+
+ if (!(*pHandle = GlobalAlloc(GMEM_ZEROINIT|GMEM_FIXED,wSize)))
+ {
+ return WN_OUT_OF_MEMORY ;
+ }
+
+ if (!(*pAligned = (LPVOID)GlobalLock(*pHandle)))
+ {
+ (void) GlobalFree(*pHandle) ;
+ *pHandle = NULL ;
+ return WN_OUT_OF_MEMORY ;
+ }
+
+ return WN_SUCCESS ;
+}
+
+/*******************************************************************
+
+ NAME: FreeAlignedMemory
+
+ SYNOPSIS: free global memory allocated by GetAlignedMemory.
+
+ ENTRY: Handle : handle of aligned memory to be freed
+
+ EXIT:
+
+ RETURNS: none
+
+ NOTES:
+
+ HISTORY:
+ ChuckC 27-Feb-94 Created
+
+********************************************************************/
+void FreeAlignedMemory(HANDLE handle)
+{
+ if (handle)
+ {
+ (void) GlobalUnlock(handle) ;
+ (void) GlobalFree(handle) ;
+ }
+}
diff --git a/private/mvdm/wow16/wfwnet/wfwnet.c b/private/mvdm/wow16/wfwnet/wfwnet.c
new file mode 100644
index 000000000..0ffd7e509
--- /dev/null
+++ b/private/mvdm/wow16/wfwnet/wfwnet.c
@@ -0,0 +1,844 @@
+/*++
+
+Copyright (c) 1989-1993 Microsoft Corporation
+
+Module Name:
+
+ wfwnet.c
+
+Abstract:
+
+ Provides entry points for the functions that will be mapped
+ to LANMAN.DRV.
+
+Author:
+
+ Chuck Y Chan (ChuckC) 25-Mar-1993
+
+Revision History:
+
+
+--*/
+#include <windows.h>
+#include <locals.h>
+
+WORD vLastCall = LAST_CALL_IS_LOCAL ;
+WORD vLastError = 0 ;
+
+WORD wNetTypeCaps ; /* Current capabilities */
+WORD wUserCaps ;
+WORD wConnectionCaps ;
+WORD wErrorCaps ;
+WORD wDialogCaps ;
+WORD wAdminCaps ;
+WORD wSpecVersion = 0x0310 ;
+WORD wDriverVersion = 0x0300 ;
+
+void I_SetCapBits(void) ;
+
+//
+// global pointers to functions
+//
+LPWNETOPENJOB lpfnWNetOpenJob = NULL ;
+LPWNETCLOSEJOB lpfnWNetCloseJob = NULL ;
+LPWNETWRITEJOB lpfnWNetWriteJob = NULL ;
+LPWNETABORTJOB lpfnWNetAbortJob = NULL ;
+LPWNETHOLDJOB lpfnWNetHoldJob = NULL ;
+LPWNETRELEASEJOB lpfnWNetReleaseJob = NULL ;
+LPWNETCANCELJOB lpfnWNetCancelJob = NULL ;
+LPWNETSETJOBCOPIES lpfnWNetSetJobCopies = NULL ;
+LPWNETWATCHQUEUE lpfnWNetWatchQueue = NULL ;
+LPWNETUNWATCHQUEUE lpfnWNetUnwatchQueue = NULL ;
+LPWNETLOCKQUEUEDATA lpfnWNetLockQueueData = NULL ;
+LPWNETUNLOCKQUEUEDATA lpfnWNetUnlockQueueData = NULL ;
+LPWNETQPOLL lpfnWNetQPoll = NULL ;
+LPWNETDEVICEMODE lpfnWNetDeviceMode = NULL ;
+LPWNETVIEWQUEUEDIALOG lpfnWNetViewQueueDialog = NULL ;
+LPWNETGETCAPS lpfnWNetGetCaps16 = NULL ;
+LPWNETGETERROR lpfnWNetGetError16 = NULL ;
+LPWNETGETERRORTEXT lpfnWNetGetErrorText16 = NULL ;
+
+extern VOID FAR PASCAL GrabInterrupts(void);
+
+int FAR PASCAL LibMain(HINSTANCE hInstance,
+ WORD wDataSeg,
+ WORD cbHeapSize,
+ LPSTR lpszCmdLine) ;
+
+/*
+ * functions passed to LANMAN.DRV
+ */
+
+WORD API WNetOpenJob(LPSTR p1,LPSTR p2,WORD p3,LPINT p4)
+{
+ WORD err ;
+
+ if (!lpfnWNetOpenJob)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetOpenJob,
+ "WNETOPENJOB" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetOpenJob)(p1,p2,p3,p4) ) ;
+}
+
+WORD API WNetCloseJob(WORD p1,LPINT p2,LPSTR p3)
+{
+ WORD err ;
+
+ if (!lpfnWNetCloseJob)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetCloseJob,
+ "WNETCLOSEJOB" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetCloseJob)(p1,p2,p3) ) ;
+}
+
+WORD API WNetWriteJob(HANDLE p1,LPSTR p2,LPINT p3)
+{
+ WORD err ;
+
+ if (!lpfnWNetWriteJob)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetWriteJob,
+ "WNETWRITEJOB" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetWriteJob)(p1,p2,p3) ) ;
+}
+
+WORD API WNetAbortJob(WORD p1,LPSTR p2)
+{
+ WORD err ;
+
+ if (!lpfnWNetAbortJob)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetAbortJob,
+ "WNETABORTJOB" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetAbortJob)(p1,p2) ) ;
+}
+
+WORD API WNetHoldJob(LPSTR p1,WORD p2)
+{
+ WORD err ;
+
+ if (!lpfnWNetHoldJob)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetHoldJob,
+ "WNETHOLDJOB" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetHoldJob)(p1,p2) ) ;
+}
+
+WORD API WNetReleaseJob(LPSTR p1,WORD p2)
+{
+ WORD err ;
+
+ if (!lpfnWNetReleaseJob)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetReleaseJob,
+ "WNETRELEASEJOB" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetReleaseJob)(p1,p2) ) ;
+}
+
+WORD API WNetCancelJob(LPSTR p1,WORD p2)
+{
+ WORD err ;
+
+ if (!lpfnWNetCancelJob)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetCancelJob,
+ "WNETCANCELJOB" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetCancelJob)(p1,p2) ) ;
+}
+
+WORD API WNetSetJobCopies(LPSTR p1,WORD p2,WORD p3)
+{
+ WORD err ;
+
+ if (!lpfnWNetSetJobCopies)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetSetJobCopies,
+ "WNETSETJOBCOPIES" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetSetJobCopies)(p1,p2,p3) ) ;
+}
+
+WORD API WNetWatchQueue(HWND p1,LPSTR p2,LPSTR p3,WORD p4)
+{
+ WORD err ;
+
+ if (!lpfnWNetWatchQueue)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetWatchQueue,
+ "WNETWATCHQUEUE" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetWatchQueue)(p1,p2,p3,p4) ) ;
+}
+
+WORD API WNetUnwatchQueue(LPSTR p1)
+{
+ WORD err ;
+
+ if (!lpfnWNetUnwatchQueue)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetUnwatchQueue,
+ "WNETUNWATCHQUEUE" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetUnwatchQueue)(p1) ) ;
+}
+
+WORD API WNetLockQueueData(LPSTR p1,LPSTR p2,LPQUEUESTRUCT FAR *p3)
+{
+ WORD err ;
+
+ if (!lpfnWNetLockQueueData)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetLockQueueData,
+ "WNETLOCKQUEUEDATA" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetLockQueueData)(p1,p2,p3) ) ;
+}
+
+WORD API WNetUnlockQueueData(LPSTR p1)
+{
+ WORD err ;
+
+ if (!lpfnWNetUnlockQueueData)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetUnlockQueueData,
+ "WNETUNLOCKQUEUEDATA" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetUnlockQueueData)(p1) ) ;
+}
+
+void API WNetQPoll(HWND hWnd, unsigned iMessage, WORD wParam, LONG lParam)
+{
+ WORD err ;
+
+ if (!lpfnWNetQPoll)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetQPoll,
+ "WNETQPOLL" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ (*lpfnWNetQPoll)(hWnd, iMessage, wParam, lParam) ;
+}
+
+WORD API WNetDeviceMode(HWND p1)
+{
+ WORD err ;
+
+ if (!lpfnWNetDeviceMode)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetDeviceMode,
+ "WNETDEVICEMODE" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetDeviceMode)(p1) ) ;
+}
+
+WORD API WNetViewQueueDialog(HWND p1,LPSTR p2)
+{
+ WORD err ;
+
+ if (!lpfnWNetViewQueueDialog)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetViewQueueDialog,
+ "WNETVIEWQUEUEDIALOG" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetViewQueueDialog)(p1,p2) ) ;
+}
+
+WORD API WNetGetCaps16(WORD p1)
+{
+ WORD err ;
+
+ if (!lpfnWNetGetCaps16)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetGetCaps16,
+ "WNETGETCAPS" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetGetCaps16)(p1) ) ;
+}
+
+WORD API WNetGetError16(LPINT p1)
+{
+ WORD err ;
+
+ if (!lpfnWNetGetError16)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetGetError16,
+ "WNETGETERROR" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetGetError16)(p1) ) ;
+}
+
+WORD API WNetGetErrorText16(WORD p1, LPSTR p2, LPINT p3)
+{
+ WORD err ;
+
+ if (!lpfnWNetGetErrorText16)
+ {
+ //
+ // start off as a our code until we get the entry point
+ //
+ vLastCall = LAST_CALL_IS_LOCAL ;
+
+ //
+ // get the entry point from LANMAN.DRV
+ //
+ err = GetLanmanDrvEntryPoints( (LPFN *)&lpfnWNetGetErrorText16,
+ "WNETGETERRORTEXT" ) ;
+ if (err)
+ {
+ SetLastError(err) ;
+ return err ;
+ }
+ }
+
+ //
+ // note it is no longer an error in our code. and call the API
+ //
+ vLastCall = LAST_CALL_IS_LANMAN_DRV ;
+ return ( (*lpfnWNetGetErrorText16)(p1,p2,p3) ) ;
+}
+
+WORD API WNetGetCaps(WORD nIndex)
+{
+ switch (nIndex)
+ {
+ case WNNC_SPEC_VERSION:
+ return wSpecVersion;
+
+ case WNNC_NET_TYPE:
+ return wNetTypeCaps;
+
+ case WNNC_DRIVER_VERSION:
+ return wDriverVersion;
+
+ case WNNC_USER:
+ return wUserCaps;
+
+ case WNNC_CONNECTION:
+ return wConnectionCaps;
+
+ case WNNC_PRINTING:
+ return (WNetGetCaps16(nIndex)) ;
+
+ case WNNC_DIALOG:
+ return wDialogCaps;
+
+ case WNNC_ADMIN:
+ return wAdminCaps;
+
+ case WNNC_ERROR:
+ return wErrorCaps;
+
+ default:
+ return 0;
+ }
+}
+
+/*
+ * misc support functions
+ */
+
+/*******************************************************************
+
+ NAME: GetLanmanDrvEntryPoints
+
+ SYNOPSIS: gets the address of the named procedure
+ from LANMAN.DRV, will load library if first time.
+
+ ENTRY: lplpfn - used to receive the address
+ lpName - name of the procedure
+
+ EXIT:
+
+ RETURNS: 0 if success, error code otherwise.
+
+ NOTES:
+
+ HISTORY:
+ ChuckC 25-Mar-93 Created
+
+********************************************************************/
+WORD GetLanmanDrvEntryPoints(LPFN *lplpfn, LPSTR lpName)
+{
+ static HINSTANCE hModule = NULL ;
+
+ //
+ // if we havent loaded it, load it now
+ //
+ if (hModule == NULL)
+ {
+ hModule = LoadLibrary(LANMAN_DRV) ;
+ if (hModule == NULL)
+ return WN_NOT_SUPPORTED ;
+ }
+
+ //
+ // get the procedure
+ //
+ *lplpfn = (LPFN) GetProcAddress(hModule, lpName) ;
+ if (! *lplpfn )
+ return WN_NOT_SUPPORTED ;
+
+ return NO_ERROR ;
+}
+
+/*******************************************************************
+
+ NAME: SetLastError
+
+ SYNOPSIS: makes note of last error
+
+ ENTRY:
+
+ EXIT:
+
+ RETURNS:
+
+ NOTES:
+
+ HISTORY:
+ ChuckC 25-Mar-93 Created
+
+********************************************************************/
+WORD SetLastError(WORD err)
+{
+ vLastError = err ;
+ return err ;
+}
+
+/*******************************************************************
+
+ NAME: LibMain
+
+ SYNOPSIS: dll init entry point. only thing we do here is init
+ the capability bits.
+
+ ENTRY:
+
+ EXIT:
+
+ RETURNS:
+
+ NOTES:
+
+ HISTORY:
+ ChuckC 25-Mar-93 Created
+
+********************************************************************/
+
+#define NETWARE_DLL "NETWARE.DRV"
+
+int FAR PASCAL LibMain(HINSTANCE hInstance,
+ WORD wDataSeg,
+ WORD cbHeapSize,
+ LPSTR lpszCmdLine)
+{
+ OFSTRUCT ofStruct ;
+ int fh ;
+ BOOL fLoadNetware = FALSE ;
+ char IsInstalledString[16] ;
+
+ UNREFERENCED(hInstance) ;
+ UNREFERENCED(wDataSeg) ;
+ UNREFERENCED(cbHeapSize) ;
+ UNREFERENCED(lpszCmdLine) ;
+
+ I_SetCapBits() ;
+
+ if (GetProfileString("NWCS",
+ "NwcsInstalled",
+ "0",
+ IsInstalledString,
+ sizeof(IsInstalledString)))
+ {
+ fLoadNetware = (lstrcmp("1",IsInstalledString)==0) ;
+ }
+
+ //
+ // if enhanced mode, grab the interrupt for NWIPXSPX
+ //
+ if ((GetWinFlags() & WF_ENHANCED) && fLoadNetware) {
+ GrabInterrupts();
+ }
+
+ //
+ // if the file NETWARE.DRV exists, we load it. we dont really
+ // use it, but some Netware aware apps require that it is loaded.
+ //
+ if (fLoadNetware &&
+ ((fh = OpenFile(NETWARE_DLL, &ofStruct, OF_READ)) != -1))
+ {
+ _lclose(fh) ;
+
+ (void)WriteProfileString("Windows",
+ "NetWarn",
+ "0") ;
+
+ (void)LoadLibrary(NETWARE_DLL) ;
+ }
+
+ return 1 ;
+}
+
+
+/*******************************************************************
+
+ NAME: I_SetCapBits
+
+ SYNOPSIS: initernal routine to set the capability bits
+
+ ENTRY:
+
+ EXIT:
+
+ RETURNS:
+
+ NOTES:
+
+ HISTORY:
+ ChuckC 25-Mar-93 Created
+
+********************************************************************/
+void I_SetCapBits(void)
+{
+ wNetTypeCaps = WNNC_NET_MultiNet |
+ WNNC_SUBNET_WinWorkgroups;
+
+ wUserCaps = WNNC_USR_GetUser;
+
+ wConnectionCaps = (WNNC_CON_AddConnection |
+ WNNC_CON_CancelConnection |
+ WNNC_CON_GetConnections |
+ WNNC_CON_AutoConnect |
+ WNNC_CON_BrowseDialog |
+ WNNC_CON_RestoreConnection ) ;
+
+ wErrorCaps = WNNC_ERR_GetError |
+ WNNC_ERR_GetErrorText;
+
+ wDialogCaps = (WNNC_DLG_DeviceMode |
+ WNNC_DLG_ShareAsDialog |
+ WNNC_DLG_PropertyDialog |
+ WNNC_DLG_ConnectionDialog |
+ WNNC_DLG_ConnectDialog |
+ WNNC_DLG_DisconnectDialog |
+ WNNC_DLG_BrowseDialog );
+
+ wAdminCaps = ( WNNC_ADM_GetDirectoryType |
+ WNNC_ADM_DirectoryNotify ) ;
+/* disable LFN for now
+ | WNNC_ADM_LongNames ) ;
+ */
+
+}
diff --git a/private/mvdm/wow16/wfwnet/wfwnet.def b/private/mvdm/wow16/wfwnet/wfwnet.def
new file mode 100644
index 000000000..f56d3456d
--- /dev/null
+++ b/private/mvdm/wow16/wfwnet/wfwnet.def
@@ -0,0 +1,102 @@
+LIBRARY WFWNET
+DESCRIPTION 'WOW REPLACEMENT WFWNET'
+EXETYPE WINDOWS
+STUB '..\BIN\WINSTUB.EXE'
+CODE PRELOAD MOVEABLE
+DATA PRELOAD MOVEABLE SINGLE
+HEAPSIZE 2048
+
+
+EXPORTS
+; standard network driver callouts
+ WNETOPENJOB @1
+ WNETCLOSEJOB @2
+ WNETABORTJOB @3
+ WNETHOLDJOB @4
+ WNETRELEASEJOB @5
+ WNETCANCELJOB @6
+ WNETSETJOBCOPIES @7
+ WNETWATCHQUEUE @8
+ WNETUNWATCHQUEUE @9
+ WNETLOCKQUEUEDATA @10
+ WNETUNLOCKQUEUEDATA @11
+ WNETGETCONNECTION @12
+ WNETGETCAPS @13
+ WNETDEVICEMODE @14
+ WNETBROWSEDIALOG @15
+ WNETGETUSER @16
+ WNETADDCONNECTION @17
+ WNETCANCELCONNECTION @18
+ WNETGETERROR @19
+ WNETGETERRORTEXT @20
+ ENABLE @21
+ DISABLE @22
+ WNETRESTORECONNECTION @23
+ WNETCONNECTDIALOG @25
+ WNETDISCONNECTDIALOG @26
+ WNETCONNECTIONDIALOG @27
+ WNETPROPERTYDIALOG @29
+ WNETGETDIRECTORYTYPE @30
+ WNETDIRECTORYNOTIFY @31
+ WNETGETPROPERTYTEXT @32
+
+; FMEXTENSIONPROC
+
+; Internal-only APIs
+ WNETQPOLL @520
+ I_AUTOLOGON @530
+ I_CHANGEPASSWORD @531
+ I_LOGOFF @532
+ I_CONNECTIONDIALOG @533
+ I_CHANGECACHEPASSWORD @534
+ I_CONNECTDIALOG @535
+
+; Long FileName support APIs
+
+ LFNFINDFIRST @100
+ LFNFINDNEXT @101
+ LFNFINDCLOSE @102
+ LFNGETATTRIBUTES @103
+ LFNSETATTRIBUTES @104
+ LFNCOPY @105
+ LFNMOVE @106
+ LFNDELETE @107
+ LFNMKDIR @108
+ LFNRMDIR @109
+ LFNGETVOLUMELABEL @110
+ LFNSETVOLUMELABEL @111
+ LFNPARSE @112
+ LFNVOLUMETYPE @113
+
+; Print Manager Extensions (not supported anymore)
+ WNETPRINTMGRCHANGEMENUS @130
+ WNETPRINTMGREXITING @131
+ WNETPRINTMGRCOMMAND @132
+ WNETPRINTMGRMOVEJOB @133
+ WNETPRINTMGRSELNOTIFY @134
+ WNETPRINTMGRPRINTERENUM @135
+ WNETPRINTMGREXTHELP @136
+ WNETPRINTMGRSTATUSCHANGE @137
+
+; New share dialog APIs for winfile
+
+ WNETSHARESDIALOG @140
+ WNETSHAREASDIALOG @141
+ WNETSTOPSHAREDIALOG @142
+ WNETSETDEFAULTDRIVE @143
+ WNETGETSHARECOUNT @144
+ WNETGETSHARENAME @145
+ WNETSERVERBROWSEDIALOG @146
+ WNETGETSHAREPATH @147
+ WNETGETLASTCONNECTION @148
+ WNETEXITCONFIRM @149
+
+; Password caching APIs (not supported)
+
+ WNETCACHEPASSWORD @150
+ WNETGETCACHEDPASSWORD @151
+ WNETREMOVECACHEDPASSWORD @152
+ WNETENUMCACHEDPASSWORDS @153
+
+ WEP @199 RESIDENTNAME
+
diff --git a/private/mvdm/wow16/wfwnet/wfwnet.rc b/private/mvdm/wow16/wfwnet/wfwnet.rc
new file mode 100644
index 000000000..3281cc82d
--- /dev/null
+++ b/private/mvdm/wow16/wfwnet/wfwnet.rc
@@ -0,0 +1,4 @@
+/********************************************************************/
+/* WFWNET.RC */
+/********************************************************************/
+#include "wfwnet.rcv"
diff --git a/private/mvdm/wow16/wfwnet/wfwnet.rcv b/private/mvdm/wow16/wfwnet/wfwnet.rcv
new file mode 100644
index 000000000..9d3061dd3
--- /dev/null
+++ b/private/mvdm/wow16/wfwnet/wfwnet.rcv
@@ -0,0 +1,12 @@
+/********************************************************************/
+/* WFWNET.RCV */
+/********************************************************************/
+#include <version.h>
+
+#define VER_FILETYPE VFT_DLL
+#define VER_FILESUBTYPE VFT2_UNKNOWN
+#define VER_FILEDESCRIPTION_STR "Windows for Workgroups network driver"
+#define VER_INTERNALNAME_STR "WFWNET"
+#define VER_ORIGINALFILENAME_STR "WFWNET.DRV"
+
+#include <common.ver>