source: trunk/src/wnetap32/wnetap32.cpp@ 7029

Last change on this file since 7029 was 6676, checked in by phaller, 24 years ago

.

File size: 45.6 KB
Line 
1/* $Id: wnetap32.cpp,v 1.16 2001-09-07 08:20:59 phaller Exp $ */
2
3/*
4 *
5 * Project Odin Software License can be found in LICENSE.TXT
6 *
7 */
8/*
9 * NETAPI32 stubs
10 *
11 * Copyright 1998 Patrick Haller
12 *
13 * Note: functions that return structures/buffers seem to append strings
14 * at the end of the buffer. Currently, we just allocate the strings
15 * "normally". Therefore a caller that just does a NetApiBufferFree() on the
16 * returned buffer will leak all allocated strings.
17 *
18 */
19/*****************************************************************************
20 * Name : WNETAP32.CPP
21 * Purpose : This module maps all Win32 functions contained in NETAPI32.DLL
22 * to their OS/2-specific counterparts as far as possible.
23 * Basis is 5.05.97 12.00 59152 MPR.DLL (NT4SP3)
24 *****************************************************************************/
25
26
27/****************************************************************************
28 * Includes *
29 ****************************************************************************/
30
31#include <odin.h>
32#include <odinwrap.h>
33#include <os2win.h>
34#include <misc.h>
35#include <unicode.h>
36#include <heapstring.h>
37#include <string.h>
38#include <winconst.h>
39
40#include "oslibnet.h"
41#include "lanman.h"
42
43ODINDEBUGCHANNEL(WNETAP32-WNETAP32)
44
45
46/****************************************************************************
47 * Module Global Variables *
48 ****************************************************************************/
49
50#define NCBNAMSZ 16
51#define MAX_LANA 254
52
53typedef struct _NCB {
54 UCHAR ncb_command;
55 UCHAR ncb_retcode;
56 UCHAR ncb_lsn;
57 UCHAR ncb_num;
58 PUCHAR ncb_buffer;
59 WORD ncb_length;
60 UCHAR ncb_callname[NCBNAMSZ];
61 UCHAR ncb_name[NCBNAMSZ];
62 UCHAR ncb_rto;
63 UCHAR ncb_sto;
64 void (* CALLBACK ncb_post)( struct _NCB * );
65 UCHAR ncb_lana_num;
66 UCHAR ncb_cmd_cplt;
67 UCHAR ncb_reserve[10];
68 HANDLE ncb_event;
69} NCB, *PNCB;
70
71#define NRC_GOODRET 0x00
72#define NRC_BUFLEN 0x01
73#define NRC_ILLCMD 0x03
74#define NRC_CMDTMO 0x05
75#define NRC_INCOMP 0x06
76#define NRC_BADDR 0x07
77#define NRC_SNUMOUT 0x08
78#define NRC_NORES 0x09
79#define NRC_SCLOSED 0x0a
80#define NRC_CMDCAN 0x0b
81#define NRC_DUPNAME 0x0d
82#define NRC_NAMTFUL 0x0e
83#define NRC_ACTSES 0x0f
84#define NRC_LOCTFUL 0x11
85#define NRC_REMTFUL 0x12
86#define NRC_ILLNN 0x13
87#define NRC_NOCALL 0x14
88#define NRC_NOWILD 0x15
89#define NRC_INUSE 0x16
90#define NRC_NAMERR 0x17
91#define NRC_SABORT 0x18
92#define NRC_NAMCONF 0x19
93#define NRC_IFBUSY 0x21
94#define NRC_TOOMANY 0x22
95#define NRC_BRIDGE 0x23
96#define NRC_CANOCCR 0x24
97#define NRC_CANCEL 0x26
98#define NRC_DUPENV 0x30
99#define NRC_ENVNOTDEF 0x34
100#define NRC_OSRESNOTAV 0x35
101#define NRC_MAXAPPS 0x36
102#define NRC_NOSAPS 0x37
103#define NRC_NORESOURCES 0x38
104#define NRC_INVADDRESS 0x39
105#define NRC_INVDDID 0x3B
106#define NRC_LOCKFAIL 0x3C
107#define NRC_OPENERR 0x3f
108#define NRC_SYSTEM 0x40
109
110#define NRC_PENDING 0xff
111
112
113//******************************************************************************
114//******************************************************************************
115ODINFUNCTION1(UCHAR, OS2Netbios,
116 PNCB, pncb)
117{
118#ifdef DEBUG
119 WriteLog("OS2Netbios; pretend no network available\n");
120#endif
121 return(NRC_OPENERR);
122}
123//******************************************************************************
124//******************************************************************************
125
126/*****************************************************************************
127 * Name : NET_API_STATUS NetAlertRaise
128 * Purpose :
129 * Parameters: LPWSTR AlertEventName Pointer to a Unicode string that specifies
130 * the interrupting message to raise
131 * LPVOID Buffer Pointer to the data to be sent to the clients
132 * listening for this interrupting message
133 * DWORD BufferSize Specifies in bytes, the size of the buffer
134 * Variables :
135 * Result :
136 * Remark :
137 * Status : UNTESTED STUB
138 *
139 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
140 *
141 * Author : Markus Montkowski [09.07.98 19:40:30]
142 *****************************************************************************/
143
144ODINFUNCTION3(NET_API_STATUS, OS2NetAlertRaise,
145 LPWSTR, AlertEventName,
146 LPVOID, Buffer,
147 DWORD, BufferSize)
148{
149
150 dprintf(("NETAPI32: NetAlertRaise not implemented\n"));
151
152 return (NERR_BASE);
153}
154
155
156/*****************************************************************************
157 * Name : NET_API_STATUS NetAlertRaiseEx
158 * Purpose :
159 * Parameters: LPWSTR AlertEventName
160 * LPVOID VariableInfo
161 * DWORD VariableInfoSize
162 * LPWSTR ServiceName
163 * Variables :
164 * Result :
165 * Remark :
166 * Status : UNTESTED STUB
167 *
168 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
169 *
170 * Author : Markus Montkowski [09.07.98 19:44:43]
171 *****************************************************************************/
172
173ODINFUNCTION4(NET_API_STATUS, OS2NetAlertRaiseEx,
174 LPWSTR, AlertEventName,
175 LPVOID, VariableInfo,
176 DWORD, VariableInfoSize,
177 LPWSTR, ServiceName)
178
179{
180
181 dprintf(("NETAPI32: NetAlertRaiseEx not implemented\n"));
182
183 return (NERR_BASE);
184}
185
186
187/*****************************************************************************
188 * Name : NET_API_STATUS NetFileEnum
189 * Purpose :
190 * Parameters: LPWSTR servername
191 * LPWSTR basepath
192 * LPWSTR username
193 * DWORD level
194 * LPBYTE *bufptr
195 * DWORD prefmaxlen
196 * LPDWORD entriesread
197 * LPDWORD totalentries
198 * LPDWORD resume_handle
199 * Variables :
200 * Result :
201 * Remark :
202 * Status : UNTESTED STUB
203 *
204 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
205 *
206 * Author : Markus Montkowski [09.07.98 21:27:44]
207 *****************************************************************************/
208
209ODINFUNCTION9(NET_API_STATUS, OS2NetFileEnum,
210 LPWSTR, servername,
211 LPWSTR, basepath,
212 LPWSTR, username,
213 DWORD, level,
214 LPBYTE *, bufptr,
215 DWORD, prefmaxlen,
216 LPDWORD, entriesread,
217 LPDWORD, totalentries,
218 LPDWORD, resume_handle)
219{
220 dprintf(("NETAPI32: NetFileEnum not implemented\n"));
221
222 return (NERR_BASE);
223}
224
225
226/*****************************************************************************
227 * Name : NET_API_STATUS NetFileGetInfo
228 * Purpose :
229 * Parameters: LPWSTR servername
230 * DWORD fileid
231 * DWORD level
232 * LPBYTE *bufptr
233 * Variables :
234 * Result :
235 * Remark :
236 * Status : UNTESTED STUB
237 *
238 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
239 *
240 * Author : Markus Montkowski [09.07.98 21:28:38]
241 *****************************************************************************/
242
243ODINFUNCTION4(NET_API_STATUS,OS2NetFileGetInfo,LPWSTR, servername,
244 DWORD, fileid,
245 DWORD, level,
246 LPBYTE*, bufptr)
247{
248 dprintf(("NETAPI32: NetFileGetInfo not implemented\n"));
249
250 return (NERR_BASE);
251}
252
253
254/*****************************************************************************
255 * Name : NET_API_STATUS NetGetAnyDCName
256 * Purpose :
257 * Parameters: LPCWSTR ServerName
258 * LPCWSTR DomainName
259 * LPBYTE *Buffer
260 * Variables :
261 * Result :
262 * Remark :
263 * Status : UNTESTED STUB
264 *
265 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
266 *
267 * Author : Markus Montkowski [09.07.98 21:29:52]
268 *****************************************************************************/
269
270ODINFUNCTION3(NET_API_STATUS, OS2NetGetAnyDCName,
271 LPCWSTR, ServerName,
272 LPCWSTR, DomainName,
273 LPBYTE *, Buffer)
274{
275 dprintf(("NETAPI32: NetGetAnyDCName not implemented\n"));
276
277 return (NERR_BASE);
278}
279
280
281/*****************************************************************************
282 * Name : NET_API_STATUS NetGetDCName
283 * Purpose :
284 * Parameters: LPWSTR servername
285 * LPWSTR domainname
286 * LPBYTE *bufptr
287 * Variables :
288 * Result :
289 * Remark :
290 * Status : UNTESTED STUB
291 *
292 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
293 *
294 * Author : Markus Montkowski [09.07.98 21:30:29]
295 *****************************************************************************/
296
297ODINFUNCTION3(NET_API_STATUS, OS2NetGetDCName,
298 LPWSTR, servername,
299 LPWSTR, domainname,
300 LPBYTE *, bufptr)
301{
302
303 dprintf(("NETAPI32: NetGetDCName not implemented\n"));
304
305 return (NERR_BASE);
306}
307
308
309/*****************************************************************************
310 * Name : NET_API_STATUS NetGetDisplayInformationIndex
311 * Purpose :
312 * Parameters: LPWSTR ServerName pointer to server to get information from
313 * DWORD Level level of information to retrieve
314 * LPWSTR Prefix pointer to prefix string
315 * LPDWORD Index receives index of entry
316 * Variables :
317 * Result :
318 * Remark :
319 * Status : UNTESTED STUB
320 *
321 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
322 *
323 * Author : Markus Montkowski [09.07.98 21:30:53]
324 *****************************************************************************/
325
326ODINFUNCTION4(NET_API_STATUS, OS2NetGetDisplayInformationIndex,
327 LPWSTR, ServerName,
328 DWORD, Level,
329 LPWSTR, Prefix,
330 LPDWORD, Index)
331{
332 dprintf(("NETAPI32: NetGetDisplayInformationIndex not implemented\n"));
333
334 return (NERR_BASE);
335}
336
337
338/*****************************************************************************
339 * Name : NET_API_STATUS NetHandleGetInfo
340 * Purpose :
341 * Parameters: UNSIGNED SHORT hHandle
342 * SHORT sLevel
343 * CHAR FAR *pbBuffer
344 * UNSIGNED SHORT cbBuffer
345 * UNSIGNED SHORT FAR *pcbTotalAvail
346 * Variables :
347 * Result :
348 * Remark :
349 * Status : UNTESTED STUB
350 *
351 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
352 *
353 * Author : Markus Montkowski [09.07.98 21:35:03]
354 *****************************************************************************/
355/* NOT in DLL but in SDK Documentation
356ODINFUNCTION5(NET_API_STATUS, OS2NetHandleGetInfo,
357 UNSIGNED, SHORT,
358 hHandle,, SHORT,
359 sLevel,, CHAR,
360 FAR *, pbBuffer,
361 UNSIGNED, SHORTcbBuffer,
362 UNSIGNED SHORT FAR *pcbTotalAvail
363 )
364
365{
366
367 dprintf(("NETAPI32: NetHandleGetInfo(%d, %d, %08x, %d, %08x) not implemented\n"
368 ,hHandle, sLevel, *pbBuffer, cbBuffer, *pcbTotalAvail
369 ));
370
371 return (NERR_BASE);
372}
373*/
374
375/*****************************************************************************
376 * Name : NET_API_STATUS NetHandleSetInfo
377 * Purpose :
378 * Parameters: UNSIGNED SHORT hHandle
379 * SHORT sLevel
380 * CHAR FAR *pbBuffer
381 * UNSIGNED SHORT cbBuffer
382 * UNSIGNED SHORT FAR *sParmNum
383 * Variables :
384 * Result :
385 * Remark :
386 * Status : UNTESTED STUB
387 *
388 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
389 *
390 * Author : Markus Montkowski [09.07.98 21:39:08]
391 *****************************************************************************/
392/* Not in DLL but in SDK Documentation
393ODINFUNCTION5(NET_API_STATUS, OS2NetHandleSetInfo,
394 UNSIGNED, SHORT,
395 hHandle,, SHORT,
396 sLevel,, CHAR,
397 FAR *, pbBuffer,
398 UNSIGNED, SHORTcbBuffer,
399 UNSIGNED SHORT FAR *sParmNum
400 )
401
402{
403
404 dprintf(("NETAPI32: NetHandleSetInfo(%d, %d, %08x, %d, %08x) not implemented\n"
405 ,hHandle, sLevel, *pbBuffer, cbBuffer, *sParmNum
406 ));
407
408 return (NERR_BASE);
409}
410
411*/
412
413
414/*****************************************************************************
415 * Name : NET_API_STATUS NetMessageBufferSend
416 * Purpose :
417 * Parameters: LPWSTR servername
418 * LPWSTR msgname
419 * LPWSTR fromname
420 * LPBYTE buf
421 * DWORD buflen
422 * Variables :
423 * Result :
424 * Remark :
425 * Status : UNTESTED STUB
426 *
427 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
428 *
429 * Author : Markus Montkowski [09.07.98 21:43:01]
430 *****************************************************************************/
431ODINFUNCTION5(NET_API_STATUS, OS2NetMessageBufferSend,
432 LPWSTR, servername,
433 LPWSTR, msgname,
434 LPWSTR, fromname,
435 LPBYTE, buf,
436 DWORD, buflen)
437
438{
439
440 dprintf(("NETAPI32: NetMessageBufferSend(%s, %s, %s, %08x, %d) not implemented\n"
441 ,servername, msgname, fromname, buf, buflen
442 ));
443
444 return (NERR_BASE);
445}
446
447
448
449/*****************************************************************************
450 * Name : NET_API_STATUS NetMessageNameAdd
451 * Purpose :
452 * Parameters: LPWSTR servername
453 * LPWSTR msgname
454 * Variables :
455 * Result :
456 * Remark :
457 * Status : UNTESTED STUB
458 *
459 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
460 *
461 * Author : Markus Montkowski [09.07.98 21:43:41]
462 *****************************************************************************/
463ODINFUNCTION2(NET_API_STATUS, OS2NetMessageNameAdd,
464 LPWSTR, servername,
465 LPWSTR, msgname)
466
467{
468
469 dprintf(("NETAPI32: NetMessageNameAdd(%s, %s) not implemented\n"
470 ,servername, msgname
471 ));
472
473 return (NERR_BASE);
474}
475
476/*****************************************************************************
477 * Name : NET_API_STATUS NetMessageNameDel
478 * Purpose :
479 * Parameters: LPWSTR servername
480 * LPWSTR msgname
481 * Variables :
482 * Result :
483 * Remark :
484 * Status : UNTESTED STUB
485 *
486 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
487 *
488 * Author : Markus Montkowski [09.07.98 21:44:12]
489 *****************************************************************************/
490ODINFUNCTION2(NET_API_STATUS, OS2NetMessageNameDel,
491 LPWSTR, servername,
492 LPWSTR, msgname)
493
494{
495
496 dprintf(("NETAPI32: NetMessageNameDel(%s, %s) not implemented\n"
497 ,servername, msgname
498 ));
499
500 return (NERR_BASE);
501}
502
503/*****************************************************************************
504 * Name : NET_API_STATUS NetMessageNameEnum
505 * Purpose :
506 * Parameters: LPWSTR servername
507 * DWORD level
508 * LPBYTE *bufptr
509 * DWORD prefmaxlen
510 * LPDWORD entriesread
511 * LPDWORD totalentries
512 * LPDWORD resume_handle
513 * Variables :
514 * Result :
515 * Remark :
516 * Status : UNTESTED STUB
517 *
518 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
519 *
520 * Author : Markus Montkowski [09.07.98 21:45:05]
521 *****************************************************************************/
522ODINFUNCTION7(NET_API_STATUS, OS2NetMessageNameEnum,
523 LPWSTR, servername,
524 DWORD, level,
525 LPBYTE *, bufptr,
526 DWORD, prefmaxlen,
527 LPDWORD, entriesread,
528 LPDWORD, totalentries,
529 LPDWORD, resume_handle)
530
531{
532
533 dprintf(("NETAPI32: NetMessageNameEnum(%s, %d, %08x, %d, %08x, %08x, %08x) not implemented\n"
534 ,servername, level, *bufptr, prefmaxlen, entriesread, totalentries, resume_handle
535 ));
536
537 return (NERR_BASE);
538}
539
540
541/*****************************************************************************
542 * Name : NET_API_STATUS NetMessageNameGetInfo
543 * Purpose :
544 * Parameters: LPWSTR servername
545 * LPWSTR msgname
546 * DWORD level
547 * LPBYTE *bufptr
548 * Variables :
549 * Result :
550 * Remark :
551 * Status : UNTESTED STUB
552 *
553 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
554 *
555 * Author : Markus Montkowski [09.07.98 21:45:40]
556 *****************************************************************************/
557ODINFUNCTION4(NET_API_STATUS, OS2NetMessageNameGetInfo,
558 LPWSTR, servername,
559 LPWSTR, msgname,
560 DWORD, level,
561 LPBYTE *, bufptr)
562
563{
564
565 dprintf(("NETAPI32: NetMessageNameGetInfo(%s, %s, %d, %08x) not implemented\n"
566 ,servername, msgname, level, *bufptr
567 ));
568
569 return (NERR_BASE);
570}
571/*****************************************************************************
572 * Name : NET_API_STATUS NetQueryDisplayInformation
573 * Purpose :
574 * Parameters: LPWSTR ServerName
575 * DWORD Level
576 * DWORD Index
577 * DWORD EntriesRequested
578 * DWORD PreferredMaximumLength
579 * LPDWORD ReturnedEntryCount
580 * PVOID *SortedBuffer
581 * Variables :
582 * Result :
583 * Remark :
584 * Status : UNTESTED STUB
585 *
586 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
587 *
588 * Author : Markus Montkowski [09.07.98 21:46:40]
589 *****************************************************************************/
590ODINFUNCTION7(NET_API_STATUS, OS2NetQueryDisplayInformation,
591 LPWSTR, ServerName,
592 DWORD, Level,
593 DWORD, Index,
594 DWORD, EntriesRequested,
595 DWORD, PreferredMaximumLength,
596 LPDWORD, ReturnedEntryCount,
597 PVOID *, SortedBuffer)
598
599{
600
601 dprintf(("NETAPI32: NetQueryDisplayInformation(%08x, %d, %d, %d, %d, %08x, %08x) not implemented\n"
602 ,ServerName, Level, Index, EntriesRequested, PreferredMaximumLength, ReturnedEntryCount, *SortedBuffer
603 ));
604
605 return (NERR_BASE);
606}
607
608/*****************************************************************************
609 * Name : NET_API_STATUS NetRemoteTOD
610 * Purpose :
611 * Parameters: LPWSTR UncServerName
612 * LPBYTE *BufferPtr
613 * Variables :
614 * Result :
615 * Remark :
616 * Status : UNTESTED STUB
617 *
618 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
619 *
620 * Author : Markus Montkowski [09.07.98 21:47:20]
621 *****************************************************************************/
622ODINFUNCTION2(NET_API_STATUS, OS2NetRemoteTOD,
623 LPWSTR, UncServerName,
624 LPBYTE *, BufferPtr)
625
626{
627
628 dprintf(("NETAPI32: NetRemoteTOD(%s, %08x) not implemented\n"
629 ,UncServerName, *BufferPtr
630 ));
631
632 return (NERR_BASE);
633}
634
635
636/*****************************************************************************
637 * Name : NET_API_STATUS NetSessionDel
638 * Purpose :
639 * Parameters: LPWSTR servername
640 * LPWSTR UncClientName
641 * LPWSTR username
642 * Variables :
643 * Result :
644 * Remark :
645 * Status : UNTESTED STUB
646 *
647 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
648 *
649 * Author : Markus Montkowski [09.07.98 22:00:15]
650 *****************************************************************************/
651ODINFUNCTION3(NET_API_STATUS, OS2NetSessionDel,
652 LPWSTR, servername,
653 LPWSTR, UncClientName,
654 LPWSTR, username)
655
656{
657
658 dprintf(("NETAPI32: NetSessionDel(%s, %s, %s) not implemented\n"
659 ,servername, UncClientName, username
660 ));
661
662 return (NERR_BASE);
663}
664
665
666/*****************************************************************************
667 * Name : NET_API_STATUS NetSessionEnum
668 * Purpose :
669 * Parameters: LPWSTR servername
670 * LPWSTR UncClientName
671 * LPWSTR username
672 * DWORD level
673 * LPBYTE *bufptr
674 * DWORD prefmaxlen
675 * LPDWORD entriesread
676 * LPDWORD totalentries
677 * LPDWORD resume_handle
678 * Variables :
679 * Result :
680 * Remark :
681 * Status : UNTESTED STUB
682 *
683 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
684 *
685 * Author : Markus Montkowski [09.07.98 22:00:46]
686 *****************************************************************************/
687ODINFUNCTION9(NET_API_STATUS, OS2NetSessionEnum,
688 LPWSTR, servername,
689 LPWSTR, UncClientName,
690 LPWSTR, username,
691 DWORD, level,
692 LPBYTE *, bufptr,
693 DWORD, prefmaxlen,
694 LPDWORD, entriesread,
695 LPDWORD, totalentries,
696 LPDWORD, resume_handle)
697
698{
699
700 dprintf(("NETAPI32: NetSessionEnum(%s, %s, %s, %d, %08x, %d, %08x, %08x, %08x) not implemented\n"
701 ,servername, UncClientName, username, level, *bufptr, prefmaxlen, entriesread, totalentries, resume_handle
702 ));
703
704 return (NERR_BASE);
705}
706
707/*****************************************************************************
708 * Name : NET_API_STATUS NetSessionGetInfo
709 * Purpose :
710 * Parameters: LPWSTR servername
711 * LPWSTR UncClientName
712 * LPWSTR username
713 * DWORD level
714 * LPBYTE *bufptr
715 * Variables :
716 * Result :
717 * Remark :
718 * Status : UNTESTED STUB
719 *
720 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
721 *
722 * Author : Markus Montkowski [09.07.98 22:01:17]
723 *****************************************************************************/
724ODINFUNCTION5(NET_API_STATUS, OS2NetSessionGetInfo,
725 LPWSTR, servername,
726 LPWSTR, UncClientName,
727 LPWSTR, username,
728 DWORD, level,
729 LPBYTE *, bufptr)
730
731{
732
733 dprintf(("NETAPI32: NetSessionGetInfo(%s, %s, %s, %d, %08x) not implemented\n"
734 ,servername, UncClientName, username, level, *bufptr
735 ));
736
737 return (NERR_BASE);
738}
739
740
741/*****************************************************************************
742 * Name : NET_API_STATUS NetStatisticsGet2
743 * Purpose :
744 * Parameters: LPWSTR server
745 * LPWSTR service
746 * DWORD level
747 * DWORD options
748 * LPBYTE *bufptr
749 * Variables :
750 * Result :
751 * Remark :
752 * Status : UNTESTED STUB
753 *
754 * Stub Generated through PE2LX Stubwizard 0.02 from Markus Montkowski
755 *
756 * Author : Markus Montkowski [09.07.98 22:04:44]
757 *****************************************************************************/
758/* Not in DLL but in SDK doc
759ODINFUNCTION5(NET_API_STATUS, OS2NetStatisticsGet2,
760 LPWSTR, server,
761 LPWSTR, service,
762 DWORD, level,
763 DWORD, options,
764 LPBYTE *, bufptr)
765
766{
767
768 dprintf(("NETAPI32: NetStatisticsGet2(%s, %s, %d, %d, %08x) not implemented\n"
769 ,server, service, level, options, *bufptr
770 ));
771
772 return (NERR_BASE);
773}
774*/
775
776
777/*****************************************************************************
778 * Name : NET_API_STATUS NetConfigSet
779 * Purpose : configure a network component
780 * Parameters: LPWSTR lpServer
781 * LPWSTR lpReserved1
782 * LPWSTR lpComponent
783 * DWORD dwLevel
784 * DWORD dwReserved2
785 * LPBYTE lpBuf
786 * DWORD dwReserved3
787 * Variables :
788 * Result :
789 * Remark :
790 * Status : UNTESTED STUB
791 *
792 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
793 *****************************************************************************/
794
795ODINFUNCTION7(NET_API_STATUS,OS2NetConfigSet,LPWSTR, lpServer,
796 LPWSTR, lpReserved1,
797 LPWSTR, lpComponent,
798 DWORD, dwLevel,
799 DWORD, dwReserved2,
800 LPBYTE, lpBuf,
801 DWORD, dwReserved3)
802{
803 dprintf(("NETAPI32: NetConfigSet not implemented\n"));
804
805 return (NERR_BASE);
806}
807
808
809/*****************************************************************************
810 * Name : NET_API_STATUS NetConfigGet
811 * Purpose : get configuration from a network component
812 * Parameters: LPWSTR lpServer
813 * LPWSTR lpComponent
814 * LPWSTR lpParameter
815 * LPBYTE lpBuf
816 * Variables :
817 * Result :
818 * Remark :
819 * Status : UNTESTED STUB
820 *
821 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
822 *****************************************************************************/
823
824ODINFUNCTION4(NET_API_STATUS,OS2NetConfigGet,LPWSTR, lpServer,
825 LPWSTR, lpComponent,
826 LPWSTR, lpParameter,
827 LPBYTE, lpBuf)
828{
829 dprintf(("NETAPI32: NetConfigGet not implemented\n"));
830
831 return (NERR_BASE);
832}
833
834
835/*****************************************************************************
836 * Name : NET_API_STATUS RxNetAccessSetInfo
837 * Purpose :
838 * Parameters: wrong
839 * Variables :
840 * Result :
841 * Remark :
842 * Status : UNTESTED STUB
843 *
844 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
845 *****************************************************************************/
846
847ODINFUNCTION6(NET_API_STATUS, OS2RxNetAccessSetInfo,
848 DWORD, x1,
849 DWORD, x2,
850 DWORD, x3,
851 DWORD, x4,
852 DWORD, x5,
853 DWORD, x6)
854{
855 dprintf(("NETAPI32: RxNetAccessSetInfo(%08x, %08xh, %08xh, %08xh, %08xh, %08xh) not implemented\n",
856 x1,
857 x2,
858 x3,
859 x4,
860 x5,
861 x6));
862
863 return (NERR_BASE);
864}
865
866
867/*****************************************************************************
868 * Name : NET_API_STATUS RxNetAccessGetInfo
869 * Purpose :
870 * Parameters: wrong
871 * Variables :
872 * Result :
873 * Remark :
874 * Status : UNTESTED STUB
875 *
876 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
877 *****************************************************************************/
878
879ODINFUNCTION6(NET_API_STATUS, OS2RxNetAccessGetInfo,
880 DWORD, x1,
881 DWORD, x2,
882 DWORD, x3,
883 DWORD, x4,
884 DWORD, x5,
885 DWORD, x6)
886{
887 dprintf(("NETAPI32: RxNetAccessGetInfo(%08x, %08xh, %08xh, %08xh, %08xh, %08xh) not implemented\n",
888 x1,
889 x2,
890 x3,
891 x4,
892 x5,
893 x6));
894
895 return (NERR_BASE);
896}
897
898
899
900/*****************************************************************************
901 * Name : NET_API_STATUS I_NetGetDCList
902 * Purpose :
903 * Parameters: wrong
904 * Variables :
905 * Result :
906 * Remark :
907 * Status : UNTESTED STUB
908 *
909 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
910 *****************************************************************************/
911
912ODINFUNCTION6(NET_API_STATUS, OS2I_NetGetDCList,
913 DWORD, x1,
914 DWORD, x2,
915 DWORD, x3,
916 DWORD, x4,
917 DWORD, x5,
918 DWORD, x6)
919{
920 dprintf(("NETAPI32: I_NetGetDCList(%08x, %08xh, %08xh, %08xh, %08xh, %08xh) not implemented\n",
921 x1,
922 x2,
923 x3,
924 x4,
925 x5,
926 x6));
927
928 return (NERR_BASE);
929}
930
931
932/*****************************************************************************
933 * Name : NET_API_STATUS I_NetNameCanonicalize
934 * Purpose :
935 * Parameters: wrong
936 * Variables :
937 * Result :
938 * Remark :
939 * Status : UNTESTED STUB
940 *
941 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
942 *****************************************************************************/
943
944ODINFUNCTION4(NET_API_STATUS, OS2I_NetNameCanonicalize,
945 DWORD, x1,
946 DWORD, x2,
947 DWORD, x3,
948 DWORD, x4)
949{
950 dprintf(("NETAPI32: I_NetNameCanonicalize(%08x, %08xh, %08xh, %08xh) not implemented\n",
951 x1,
952 x2,
953 x3,
954 x4));
955
956 return (NERR_BASE);
957}
958
959
960
961/*****************************************************************************
962 * Name : NET_API_STATUS I_NetNameCompare
963 * Purpose :
964 * Parameters: wrong
965 * Variables :
966 * Result :
967 * Remark :
968 * Status : UNTESTED STUB
969 *
970 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
971 *****************************************************************************/
972
973ODINFUNCTION4(NET_API_STATUS, OS2I_NetNameCompare,
974 DWORD, x1,
975 DWORD, x2,
976 DWORD, x3,
977 DWORD, x4)
978{
979 dprintf(("NETAPI32: I_NetNameCompare(%08x, %08xh, %08xh, %08xh) not implemented\n",
980 x1,
981 x2,
982 x3,
983 x4));
984
985 return (NERR_BASE);
986}
987
988
989/*****************************************************************************
990 * Name : NET_API_STATUS I_NetNameValidate
991 * Purpose :
992 * Parameters: wrong
993 * Variables :
994 * Result :
995 * Remark :
996 * Status : UNTESTED STUB
997 *
998 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
999 *****************************************************************************/
1000
1001ODINFUNCTION3(NET_API_STATUS, OS2I_NetNameValidate,
1002 DWORD, x1,
1003 DWORD, x2,
1004 DWORD, x3)
1005{
1006 dprintf(("NETAPI32: I_NetNameValidate(%08x, %08xh, %08xh) not implemented\n",
1007 x1,
1008 x2,
1009 x3));
1010
1011 return (NERR_BASE);
1012}
1013
1014
1015/*****************************************************************************
1016 * Name : NET_API_STATUS I_NetPathCanonicalize
1017 * Purpose :
1018 * Parameters: wrong
1019 * Variables :
1020 * Result :
1021 * Remark :
1022 * Status : UNTESTED STUB
1023 *
1024 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
1025 *****************************************************************************/
1026
1027ODINFUNCTION4(NET_API_STATUS, OS2I_NetPathCanonicalize,
1028 DWORD, x1,
1029 DWORD, x2,
1030 DWORD, x3,
1031 DWORD, x4)
1032{
1033 dprintf(("NETAPI32: I_NetPathCanonicalize(%08x, %08xh, %08xh, %08xh) not implemented\n",
1034 x1,
1035 x2,
1036 x3,
1037 x4));
1038
1039 return (NERR_BASE);
1040}
1041
1042
1043
1044/*****************************************************************************
1045 * Name : NET_API_STATUS I_NetPathCompare
1046 * Purpose :
1047 * Parameters: wrong
1048 * Variables :
1049 * Result :
1050 * Remark :
1051 * Status : UNTESTED STUB
1052 *
1053 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
1054 *****************************************************************************/
1055
1056ODINFUNCTION4(NET_API_STATUS, OS2I_NetPathCompare,
1057 DWORD, x1,
1058 DWORD, x2,
1059 DWORD, x3,
1060 DWORD, x4)
1061{
1062 dprintf(("NETAPI32: I_NetPathCompare(%08x, %08xh, %08xh, %08xh) not implemented\n",
1063 x1,
1064 x2,
1065 x3,
1066 x4));
1067
1068 return (NERR_BASE);
1069}
1070
1071
1072/*****************************************************************************
1073 * Name : NET_API_STATUS I_NetPathType
1074 * Purpose :
1075 * Parameters: wrong
1076 * Variables :
1077 * Result :
1078 * Remark :
1079 * Status : UNTESTED STUB
1080 *
1081 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
1082 *****************************************************************************/
1083
1084ODINFUNCTION2(NET_API_STATUS, OS2I_NetPathType,
1085 DWORD, x1,
1086 DWORD, x2)
1087{
1088 dprintf(("NETAPI32: I_NetPathType(%08x, %08xh) not implemented\n",
1089 x1,
1090 x2));
1091
1092 return (NERR_BASE);
1093}
1094
1095
1096/*****************************************************************************
1097 * Name : NET_API_STATUS NetapipBufferAllocate
1098 * Purpose :
1099 * Parameters: wrong
1100 * Variables :
1101 * Result :
1102 * Remark :
1103 * Status : UNTESTED STUB
1104 *
1105 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
1106 *****************************************************************************/
1107
1108ODINFUNCTION3(NET_API_STATUS, OS2NetapipBufferAllocate,
1109 DWORD, x1,
1110 DWORD, x2,
1111 DWORD, x3)
1112{
1113 dprintf(("NETAPI32: NetapipBufferAllocate(%08x, %08xh, %08xh) not implemented\n",
1114 x1,
1115 x2,
1116 x3));
1117
1118 return (NERR_BASE);
1119}
1120
1121
1122/*****************************************************************************
1123 * Name : NET_API_STATUS I_NetLogonControl
1124 * Purpose :
1125 * Parameters: wrong
1126 * Variables :
1127 * Result :
1128 * Remark :
1129 * Status : UNTESTED STUB
1130 *
1131 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
1132 *****************************************************************************/
1133
1134ODINFUNCTION6(NET_API_STATUS, OS2I_NetLogonControl,
1135 DWORD, x1,
1136 DWORD, x2,
1137 DWORD, x3,
1138 DWORD, x4,
1139 DWORD, x5,
1140 DWORD, x6)
1141{
1142 dprintf(("NETAPI32: I_NetLogonControl(%08x, %08xh, %08xh, %08xh, %08xh, %08xh) not implemented\n",
1143 x1,
1144 x2,
1145 x3,
1146 x4,
1147 x5,
1148 x6));
1149
1150 return (NERR_BASE);
1151}
1152
1153
1154/*****************************************************************************
1155 * Name : NET_API_STATUS RxNetAccessAdd
1156 * Purpose :
1157 * Parameters: wrong
1158 * Variables :
1159 * Result :
1160 * Remark :
1161 * Status : UNTESTED STUB
1162 *
1163 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
1164 *****************************************************************************/
1165
1166ODINFUNCTION6(NET_API_STATUS, OS2RxNetAccessAdd,
1167 DWORD, x1,
1168 DWORD, x2,
1169 DWORD, x3,
1170 DWORD, x4,
1171 DWORD, x5,
1172 DWORD, x6)
1173{
1174 dprintf(("NETAPI32: RxNetAccessAdd(%08x, %08xh, %08xh, %08xh, %08xh, %08xh) not implemented\n",
1175 x1,
1176 x2,
1177 x3,
1178 x4,
1179 x5,
1180 x6));
1181
1182 return (NERR_BASE);
1183}
1184
1185
1186/*****************************************************************************
1187 * Name : NET_API_STATUS RxNetAccessDel
1188 * Purpose :
1189 * Parameters: wrong
1190 * Variables :
1191 * Result :
1192 * Remark :
1193 * Status : UNTESTED STUB
1194 *
1195 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
1196 *****************************************************************************/
1197
1198ODINFUNCTION6(NET_API_STATUS, OS2RxNetAccessDel,
1199 DWORD, x1,
1200 DWORD, x2,
1201 DWORD, x3,
1202 DWORD, x4,
1203 DWORD, x5,
1204 DWORD, x6)
1205{
1206 dprintf(("NETAPI32: RxNetAccessDel(%08x, %08xh, %08xh, %08xh, %08xh, %08xh) not implemented\n",
1207 x1,
1208 x2,
1209 x3,
1210 x4,
1211 x5,
1212 x6));
1213
1214 return (NERR_BASE);
1215}
1216
1217
1218
1219/*****************************************************************************
1220 * Name : NET_API_STATUS RxNetAccessEnum
1221 * Purpose :
1222 * Parameters: wrong
1223 * Variables :
1224 * Result :
1225 * Remark :
1226 * Status : UNTESTED STUB
1227 *
1228 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
1229 *****************************************************************************/
1230
1231ODINFUNCTION6(NET_API_STATUS, OS2RxNetAccessEnum,
1232 DWORD, x1,
1233 DWORD, x2,
1234 DWORD, x3,
1235 DWORD, x4,
1236 DWORD, x5,
1237 DWORD, x6)
1238{
1239 dprintf(("NETAPI32: RxNetAccessEnum(%08x, %08xh, %08xh, %08xh, %08xh, %08xh) not implemented\n",
1240 x1,
1241 x2,
1242 x3,
1243 x4,
1244 x5,
1245 x6));
1246
1247 return (NERR_BASE);
1248}
1249
1250
1251
1252/*****************************************************************************
1253 * Name : NET_API_STATUS RxNetAccessGetUserPerms
1254 * Purpose :
1255 * Parameters: wrong
1256 * Variables :
1257 * Result :
1258 * Remark :
1259 * Status : UNTESTED STUB
1260 *
1261 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
1262 *****************************************************************************/
1263
1264ODINFUNCTION6(NET_API_STATUS, OS2RxNetAccessGetUserPerms,
1265 DWORD, x1,
1266 DWORD, x2,
1267 DWORD, x3,
1268 DWORD, x4,
1269 DWORD, x5,
1270 DWORD, x6)
1271{
1272 dprintf(("NETAPI32: RxNetAccessGetUserPerms(%08x, %08xh, %08xh, %08xh, %08xh, %08xh) not implemented\n",
1273 x1,
1274 x2,
1275 x3,
1276 x4,
1277 x5,
1278 x6));
1279
1280 return (NERR_BASE);
1281}
1282
1283
1284/*****************************************************************************
1285 * Name : NET_API_STATUS NetConfigGetAll
1286 * Purpose : retrieves all the configuration information for a given component
1287 * on a local or remote computer
1288 * Parameters: LPWSTR lpServerName
1289 * LPWSTR lpComponent
1290 * LPBYTE* bufptr
1291 * Variables :
1292 * Result :
1293 * Remark :
1294 * Status : UNTESTED STUB
1295 *
1296 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
1297 *****************************************************************************/
1298
1299ODINFUNCTION3(NET_API_STATUS,OS2NetConfigGetAll,LPWSTR, lpServerName,
1300 LPWSTR, lpComponent,
1301 LPBYTE*, bufptr)
1302{
1303 dprintf(("NETAPI32: NetConfigGetAll not implemented\n"));
1304
1305 return (NERR_BASE);
1306}
1307
1308
1309
1310/*****************************************************************************
1311 * Name : NET_API_STATUS NetConnectionEnum
1312 * Purpose : lists all connections made to a shared resource
1313 * Parameters: LPWSTR lpServerName
1314 * LPWSTR lpQualifier
1315 * DWORD dwLevel
1316 * LPBYTE* bufptr
1317 * DWORD dwPrefMaxLen
1318 * LPDWORD dwEntriesRead
1319 * LPDWORD dwTotalEntries
1320 * LPDWORD dwResumeHandle
1321 * Variables :
1322 * Result :
1323 * Remark :
1324 * Status : UNTESTED STUB
1325 *
1326 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
1327 *****************************************************************************/
1328
1329ODINFUNCTION8(NET_API_STATUS,OS2NetConnectionEnum,LPWSTR, lpServerName,
1330 LPWSTR, lpQualifier,
1331 DWORD, dwLevel,
1332 LPBYTE*, bufptr ,
1333 DWORD, dwPrefMaxLen,
1334 LPDWORD, dwEntriesRead,
1335 LPDWORD, dwTotalEntries,
1336 LPDWORD, dwResumeHandle)
1337{
1338 dprintf(("NETAPI32: NetConnectionEnum not implemented\n"));
1339
1340 return (NERR_BASE);
1341}
1342
1343
1344/*****************************************************************************
1345 * Name : NET_API_STATUS NetFileClose
1346 * Purpose : forces a resource to close
1347 * Parameters: LPWSTR lpServerName
1348 * DWORD fileid
1349 * Variables :
1350 * Result :
1351 * Remark :
1352 * Status : UNTESTED STUB
1353 *
1354 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
1355 *****************************************************************************/
1356
1357ODINFUNCTION2(NET_API_STATUS,OS2NetFileClose,LPWSTR, lpServerName,
1358 DWORD, fileid)
1359{
1360 dprintf(("NETAPI32: NetFileClose not implemented\n"));
1361
1362 return (NERR_BASE);
1363}
1364
1365
1366/*****************************************************************************
1367 * Name : NET_API_STATUS NetStatisticsGet
1368 * Purpose : retrieves operating statistics for a service
1369 * Parameters: LPWSTR lpServerName
1370 * LPWSTR lpService
1371 * DWORD dwLevel
1372 * DWORD dwOptions
1373 * LPBYTE* bufptr
1374 * Variables :
1375 * Result :
1376 * Remark :
1377 * Status : UNTESTED STUB
1378 *
1379 * Author : Patrick Haller [Thu, 1999/08/18 00:15]
1380 *****************************************************************************/
1381
1382void UL2LI(PLARGE_INTEGER pli, ULONG ul)
1383{
1384 pli->LowPart = ul;
1385 pli->HighPart = 0;
1386}
1387
1388void LOHI2LI(PLARGE_INTEGER pli, ULONG lo, ULONG hi)
1389{
1390 pli->LowPart = lo;
1391 pli->HighPart = hi;
1392}
1393
1394
1395ODINFUNCTION5(NET_API_STATUS,OS2NetStatisticsGet,LPWSTR, lpServerName,
1396 LPWSTR, lpService,
1397 DWORD, dwLevel,
1398 DWORD, dwOptions,
1399 LPBYTE*, bufptr)
1400{
1401 // Note: as we use the static addresses of the strings
1402 // for a faster comparsion, the compiler may NOT
1403 // merge duplicate static const strings.
1404 static LPSTR SERVICE_SERVER = "SERVER";
1405 static LPSTR SERVICE_REQUESTER_NT = "REQUESTER";
1406 static LPSTR SERVICE_REQUESTER_LM = "REQUESTER";
1407 static LPSTR SERVICE_UNKNOWN = "UNKNOWN";
1408
1409 // Convert servername to ASCII
1410 // Convert service name to ASCII AND OS/2-Pendant
1411 // OS/2 only allowes "SERVER" and "REQUESTER"
1412 char *asciiServername = NULL;
1413 if (lpServerName) asciiServername = UnicodeToAsciiString(lpServerName);
1414
1415 // server remains
1416 LPSTR lpstrOS2Service = NULL;
1417 if (lpService != NULL)
1418 if (lstrcmpiW((LPCWSTR)L"WORKSTATION", (LPCWSTR)lpService) == 0) lpstrOS2Service = (LPSTR)SERVICE_REQUESTER_NT;
1419 else
1420 if (lstrcmpW((LPCWSTR)L"LanmanWorkstation", (LPCWSTR)lpService) == 0) lpstrOS2Service = (LPSTR)SERVICE_REQUESTER_LM;
1421 else
1422 if (lstrcmpiW((LPCWSTR)L"SERVER", (LPCWSTR)lpService) == 0) lpstrOS2Service = (LPSTR)SERVICE_SERVER;
1423 else
1424 if (lstrcmpW((LPCWSTR)L"LanmanServer", (LPCWSTR)lpService) == 0) lpstrOS2Service = (LPSTR)SERVICE_SERVER;
1425 else
1426 lpstrOS2Service = (LPSTR)SERVICE_UNKNOWN; // to prevent crashes in NETAPI
1427
1428 // Note: The Win32 docs say nothing about "LanmanWorkstation"
1429 // Probably this is a request for the LANMAN-Workstation specific data?
1430#ifdef DEBUG
1431 {
1432 char *asciiService = UnicodeToAsciiString(lpService);
1433 dprintf(("WINMM: NetStatisticsGet server=[%s], service=[%s]\n",
1434 asciiServername,
1435 asciiService));
1436 FreeAsciiString(asciiService);
1437 }
1438#endif
1439
1440
1441 // @@@PH convert information modes!
1442 int iOS2Level = dwLevel; // both must be 0
1443 int iOS2Options = dwOptions; // seems to be identical
1444
1445 ULONG ulBytesAvailable;
1446 DWORD rc;
1447
1448 // determine required size of buffer
1449 char pOS2Buffer[4096];
1450 rc = OSLibNetStatisticsGet((const unsigned char*)asciiServername,
1451 (const unsigned char*)lpstrOS2Service,
1452 0,
1453 iOS2Level,
1454 iOS2Options,
1455 (unsigned char*)pOS2Buffer,
1456 sizeof(pOS2Buffer),
1457 &ulBytesAvailable);
1458
1459 if (asciiServername) FreeAsciiString(asciiServername);
1460
1461 // convert the structures
1462 switch (dwLevel)
1463 {
1464 case 0:
1465 // Note: address comparsion is valid :)
1466 if (lpstrOS2Service == SERVICE_REQUESTER_NT)
1467 {
1468 PSTAT_WORKSTATION_NT_0 pstw0;
1469 struct stat_workstation_0 *pOS2stw0 = (struct stat_workstation_0 *)pOS2Buffer;
1470
1471 // calculate new size for target buffer
1472 rc = OS2NetApiBufferAllocate(sizeof(STAT_WORKSTATION_NT_0), (LPVOID*)&pstw0);
1473 if (!rc)
1474 {
1475 // buffer is zeroed?
1476 //memset(pstw0, 0, sizeof(STAT_WORKSTATION_0));
1477
1478 UL2LI (&pstw0->StatisticsStartTime, pOS2stw0->stw0_start);
1479 LOHI2LI(&pstw0->BytesReceived, pOS2stw0->stw0_bytesrcvd_r_lo, pOS2stw0->stw0_bytesrcvd_r_hi);
1480 pstw0->SmbsReceived;
1481 pstw0->PagingReadBytesRequested;
1482 pstw0->NonPagingReadBytesRequested;
1483 pstw0->CacheReadBytesRequested;
1484 pstw0->NetworkReadBytesRequested;
1485 LOHI2LI(&pstw0->BytesTransmitted, pOS2stw0->stw0_bytessent_r_lo, pOS2stw0->stw0_bytessent_r_hi);
1486 pstw0->SmbsTransmitted;
1487 pstw0->PagingWriteBytesRequested;
1488 pstw0->NonPagingWriteBytesRequested;
1489 pstw0->CacheWriteBytesRequested;
1490 pstw0->NetworkWriteBytesRequested;
1491
1492 pstw0->InitiallyFailedOperations;
1493 pstw0->FailedCompletionOperations;
1494 pstw0->ReadOperations;
1495 pstw0->RandomReadOperations;
1496 pstw0->ReadSmbs;
1497 pstw0->LargeReadSmbs;
1498 pstw0->SmallReadSmbs;
1499 pstw0->WriteOperations;
1500 pstw0->RandomWriteOperations;
1501 pstw0->WriteSmbs;
1502 pstw0->LargeWriteSmbs;
1503 pstw0->SmallWriteSmbs;
1504 pstw0->RawReadsDenied;
1505 pstw0->RawWritesDenied;
1506
1507 pstw0->NetworkErrors;
1508 pstw0->Sessions = pOS2stw0->stw0_sesstart;
1509 pstw0->FailedSessions = pOS2stw0->stw0_sessfailcon;
1510 pstw0->Reconnects = pOS2stw0->stw0_autorec;
1511 pstw0->CoreConnects;
1512 pstw0->Lanman20Connects;
1513 pstw0->Lanman21Connects;
1514 pstw0->LanmanNtConnects;
1515 pstw0->ServerDisconnects;
1516 pstw0->HungSessions = pOS2stw0->stw0_sessbroke;
1517 pstw0->UseCount = pOS2stw0->stw0_uses;
1518 pstw0->FailedUseCount = pOS2stw0->stw0_usefail;
1519 pstw0->CurrentCommands;
1520 }
1521 // the caller is responsible for freeing the memory!
1522 *bufptr = (LPBYTE)pstw0;
1523 }
1524 else
1525 if (lpstrOS2Service == SERVICE_REQUESTER_LM)
1526 {
1527 // LanmanWorkstation !
1528 PSTAT_WORKSTATION_LM_0 pstw0;
1529 struct stat_workstation_0 *pOS2stw0 = (struct stat_workstation_0 *)pOS2Buffer;
1530
1531 // calculate new size for target buffer
1532 rc = OS2NetApiBufferAllocate(sizeof(STAT_WORKSTATION_LM_0), (LPVOID*)&pstw0);
1533 if (!rc)
1534 {
1535 // Note: the really nice thing is, the lanman structures are
1536 // exactly identical between OS/2 and NT ... :)
1537 memcpy(pstw0,
1538 pOS2stw0,
1539 sizeof(STAT_WORKSTATION_LM_0));
1540 }
1541
1542 // the caller is responsible for freeing the memory!
1543 *bufptr = (LPBYTE)pstw0;
1544 }
1545 else
1546 if (lpstrOS2Service == SERVICE_SERVER)
1547 {
1548 // SERVER !
1549 PSTAT_SERVER_0 psts0;
1550 struct stat_server_0 *pOS2sts0 = (struct stat_server_0 *)pOS2Buffer;
1551
1552 // calculate new size for target buffer
1553 rc = OS2NetApiBufferAllocate(sizeof(STAT_SERVER_0), (LPVOID*)&psts0);
1554 if (!rc)
1555 {
1556 // Note: the really nice thing is, the server structures are
1557 // exactly identical between OS/2 and NT ... :)
1558 memcpy(psts0,
1559 pOS2sts0,
1560 sizeof(STAT_SERVER_0));
1561 }
1562
1563 // the caller is responsible for freeing the memory!
1564 *bufptr = (LPBYTE)psts0;
1565 }
1566
1567 break;
1568 }
1569
1570 return (rc);
1571}
1572
1573
Note: See TracBrowser for help on using the repository browser.