source: trunk/src/mpr/MPR.CPP@ 46

Last change on this file since 46 was 46, checked in by sandervl, 26 years ago

* empty log message *

File size: 41.3 KB
Line 
1/*
2 *
3 * Project Odin Software License can be found in LICENSE.TXT
4 *
5 */
6/*
7 * MPR apis
8 *
9 * 1998/06/12
10 *
11 * Copyright 1998 Patrick Haller
12 */
13/*****************************************************************************
14 * Name : MPR.CPP
15 * Purpose : This module maps all Win32 functions contained in MPR.DLL
16 * to their OS/2-specific counterparts as far as possible.
17 * Basis is 5.05.97 12.00 59152 MPR.DLL (NT4SP3)
18 *****************************************************************************/
19
20#include <os2win.h>
21#include <wnet.h>
22#include <string.h>
23#include "misc.h"
24#include "mpr.h"
25
26// Undocumented Stuff
27// MPR.DLL of Windows NT
28
29// WIN32API MultinetGetConnectionPerformanceA
30// WIN32API MultinetGetConnectionPerformanceW
31// WIN32API MultinetGetErrorTextA
32// WIN32API MultinetGetErrorTextW
33// WIN32API RestoreConnectionA0
34// WIN32API WNetClearConnections
35// WIN32API WNetConnectionDialog1A
36// WIN32API WNetConnectionDialog1W
37// WIN32API WNetConnectionDialog2
38// WIN32API WNetDirectoryNotifyA
39// WIN32API WNetDirectoryNotifyW
40// WIN32API WNetDisconnectDialog1A
41// WIN32API WNetDisconnectDialog1W
42// WIN32API WNetDisconnectDialog2
43// WIN32API WNetFMXEditPerm FileManager Extensions ?
44// WIN32API WNetFMXGetPermCaps
45// WIN32API WNetFMXGetPermHelp
46// WIN32API WNetFormatNetworkNameA
47// WIN32API WNetFormatNetworkNameW
48// WIN32API WNetGetConnection2A
49// WIN32API WNetGetConnection2W
50// WIN32API WNetGetConnection3A
51// WIN32API WNetGetConnection3W
52// WIN32API WNetGetDirectoryTypeA
53// WIN32API WNetGetDirectoryTypeW
54// WIN32API WNetGetHomeDirectoryW NT specific
55// WIN32API WNetGetNetworkInformationA
56// WIN32API WNetGetNetworkInformationW
57// WIN32API WNetGetPropertyTextA
58// WIN32API WNetGetPropertyTextW
59// WIN32API WNetGetProviderNameA
60// WIN32API WNetGetProviderNameW
61// WIN32API WNetGetSearchDialog
62// WIN32API WNetLogonNotify
63// WIN32API WNetPasswordChangeNotify
64// WIN32API WNetPropertyDialogA
65// WIN32API WNetPropertyDialogW
66// WIN32API WNetRestoreConnectionW
67// WIN32API WNetSetConnectionA
68// WIN32API WNetSetConnectionW
69// WIN32API WNetSetLastErrorA PH: implemented
70// WIN32API WNetSetLastErrorW PH: implemented
71// WIN32API WNetSupportGlobalEnum
72// WIN32API WNetUseConnectionA
73// WIN32API WNetUseConnectionW
74
75
76/****************************************************************************
77 * Module Global Variables *
78 ****************************************************************************/
79
80static struct _MPRGlobals
81{
82 DWORD dwLastError; /* most recent extended error code set by a net func */
83} MPRGLOBALS;
84
85
86
87/*****************************************************************************
88 * Name : DWORD WIN32API WNetAddConnection2A
89 * Purpose : The WNetAddConnection2 function makes a connection to a network
90 * resource. The function can redirect a local device to the network
91 * resource.
92 * Parameters: LPNETRESOURCE lpNetResource points to structure that specifies
93 * connection details
94 * LPCSTR lpPassword points to password string
95 * LPCSTR lpUsername points to user name string
96 * DWORD fdwConnection set of bit flags that specify
97 * connection options
98 * Variables :
99 * Result : API-Returncode
100 * Remark :
101 * Status : UNTESTED STUB
102 *
103 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
104 *****************************************************************************/
105
106DWORD WIN32API OS2WNetAddConnection2A(LPNETRESOURCEA lpNetResource,
107 LPCSTR lpPassword,
108 LPCSTR lpUsername,
109 DWORD fdwConnection)
110{
111 dprintf(("MPR:WNetAddConnection2A (%08x,%s,%s,%08x) not implemented.\n",
112 lpNetResource,
113 lpPassword,
114 lpUsername,
115 fdwConnection));
116
117 return (ERROR_NO_NETWORK);
118}
119
120
121/*****************************************************************************
122 * Name : DWORD WIN32API WNetAddConnection2W
123 * Purpose : The WNetAddConnection2 function makes a connection to a network
124 * resource. The function can redirect a local device to the network
125 * resource.
126 * Parameters: LPNETRESOURCE lpNetResource points to structure that specifies
127 * connection details
128 * LPCSTR lpPassword points to password string
129 * LPCSTR lpUsername points to user name string
130 * DWORD fdwConnection set of bit flags that specify
131 * connection options
132 * Variables :
133 * Result : API-Returncode
134 * Remark :
135 * Status : UNTESTED STUB
136 *
137 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
138 *****************************************************************************/
139
140DWORD WIN32API OS2WNetAddConnection2W(LPNETRESOURCEW lpNetResource,
141 LPCWSTR lpPassword,
142 LPCWSTR lpUsername,
143 DWORD fdwConnection)
144{
145 dprintf(("MPR:WNetAddConnection2W (%08x,%s,%s,%08x) not implemented.\n",
146 lpNetResource,
147 lpPassword,
148 lpUsername,
149 fdwConnection));
150
151 return (ERROR_NO_NETWORK);
152}
153
154
155
156/*****************************************************************************
157 * Name : DWORD WIN32API WNetAddConnection3A
158 * Purpose : The WNetAddConnection3 function makes a connection to a network
159 * resource. The function can redirect a local device to the network
160 * resource.
161 * Parameters: HWND hwndOwner handle to an owner window for dialog
162 * LPNETRESOURCE lpNetResource points to structure that specifies
163 * connection details
164 * LPCSTR lpPassword points to password string
165 * LPCSTR lpUsername points to user name string
166 * DWORD fdwConnection set of bit flags that specify
167 * connection options
168 * Variables :
169 * Result : API-Returncode
170 * Remark :
171 * Status : UNTESTED STUB
172 *
173 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
174 *****************************************************************************/
175
176DWORD WIN32API OS2WNetAddConnection3A(HWND hwndOwner,
177 LPNETRESOURCEA lpNetResource,
178 LPCSTR lpPassword,
179 LPCSTR lpUsername,
180 DWORD fdwConnection)
181{
182 dprintf(("MPR:WNetAddConnection3A (%08x,%08x,%s,%s,%08x) not implemented.\n",
183 hwndOwner,
184 lpNetResource,
185 lpPassword,
186 lpUsername,
187 fdwConnection));
188
189 return (ERROR_NO_NETWORK);
190}
191
192
193/*****************************************************************************
194 * Name : DWORD WIN32API WNetAddConnection3W
195 * Purpose : The WNetAddConnection3 function makes a connection to a network
196 * resource. The function can redirect a local device to the network
197 * resource.
198 * Parameters: HWND hwndOwner handle to an owner window for dialog
199 * LPNETRESOURCE lpNetResource points to structure that specifies
200 * connection details
201 * LPCSTR lpPassword points to password string
202 * LPCSTR lpUsername points to user name string
203 * DWORD fdwConnection set of bit flags that specify
204 * connection options
205 * Variables :
206 * Result : API-Returncode
207 * Remark :
208 * Status : UNTESTED STUB
209 *
210 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
211 *****************************************************************************/
212
213DWORD WIN32API OS2WNetAddConnection3W(HWND hwndOwner,
214 LPNETRESOURCEW lpNetResource,
215 LPCWSTR lpPassword,
216 LPCWSTR lpUsername,
217 DWORD fdwConnection)
218{
219 dprintf(("MPR:WNetAddConnection3W (%08x,%08x,%s,%s,%08x) not implemented.\n",
220 hwndOwner,
221 lpNetResource,
222 lpPassword,
223 lpUsername,
224 fdwConnection));
225
226 return (ERROR_NO_NETWORK);
227}
228
229
230/*****************************************************************************
231 * Name : DWORD WIN32API WNetAddConnectionA
232 * Purpose : The WNetAddConnection function makes a connection to a network
233 * resource. The function can redirect a local device to the network
234 * resource.
235 * Parameters: LPCSTR lpRemoteName address of network device name
236 * LPCSTR lpPassword points to password string
237 * LPCSTR lpUsername points to user name string
238 * Variables :
239 * Result : API-Returncode
240 * Remark :
241 * Status : UNTESTED STUB
242 *
243 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
244 *****************************************************************************/
245
246DWORD WIN32API OS2WNetAddConnectionA(LPCSTR lpRemoteName,
247 LPCSTR lpPassword,
248 LPCSTR lpUsername)
249{
250 dprintf(("MPR:WNetAddConnectionA (%s,%s,%s) not implemented.\n",
251 lpRemoteName,
252 lpPassword,
253 lpUsername));
254
255 return (ERROR_NO_NETWORK);
256}
257
258
259/*****************************************************************************
260 * Name : DWORD WIN32API WNetAddConnectionW
261 * Purpose : The WNetAddConnection function makes a connection to a network
262 * resource. The function can redirect a local device to the network
263 * resource.
264 * Parameters: LPCWSTR lpRemoteName address of network device name
265 * LPCWSTR lpPassword points to password string
266 * LPCWSTR lpUsername points to user name string
267 * Variables :
268 * Result : API-Returncode
269 * Remark :
270 * Status : UNTESTED STUB
271 *
272 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
273 *****************************************************************************/
274
275DWORD WIN32API OS2WNetAddConnectionW(LPCWSTR lpRemoteName,
276 LPCWSTR lpPassword,
277 LPCWSTR lpUsername)
278{
279 dprintf(("MPR:WNetAddConnectionW (%s,%s,%s) not implemented.\n",
280 lpRemoteName,
281 lpPassword,
282 lpUsername));
283
284 return (ERROR_NO_NETWORK);
285}
286
287
288/*****************************************************************************
289 * Name : DWORD WIN32API WNetCancelConnection2A
290 * Purpose : The WNetCancelConnection2 function breaks an existing network
291 * connection. It can also be used to remove remembered network
292 * connections that are not currently connected. This function
293 * supersedes WNetCancelConnection.
294 * Parameters: LPTSTR lpszName address of resource name to disconnect
295 * DWORD fdwConnection connection type flags
296 * BOOL fForce flag for unconditional disconnect
297 * Variables :
298 * Result : API-Returncode
299 * Remark :
300 * Status : UNTESTED STUB
301 *
302 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
303 *****************************************************************************/
304
305DWORD WIN32API OS2WNetCancelConnection2A(LPTSTR lpszName,
306 DWORD fdwConnection,
307 BOOL fForce)
308{
309 dprintf(("MPR:WNetCancelConnection2A (%s,%08x,%u) not implemented.\n",
310 lpszName,
311 fdwConnection,
312 fForce));
313
314 return (ERROR_NOT_CONNECTED);
315}
316
317
318/*****************************************************************************
319 * Name : DWORD WIN32API WNetCancelConnection2W
320 * Purpose : The WNetCancelConnection2 function breaks an existing network
321 * connection. It can also be used to remove remembered network
322 * connections that are not currently connected. This function
323 * supersedes WNetCancelConnection.
324 * Parameters: LPTSTR lpszName address of resource name to disconnect
325 * DWORD fdwConnection connection type flags
326 * BOOL fForce flag for unconditional disconnect
327 * Variables :
328 * Result : API-Returncode
329 * Remark :
330 * Status : UNTESTED STUB
331 *
332 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
333 *****************************************************************************/
334
335DWORD WIN32API OS2WNetCancelConnection2W(LPWSTR lpszName,
336 DWORD fdwConnection,
337 BOOL fForce)
338{
339 dprintf(("MPR:WNetCancelConnection2W (%s,%08x,%u) not implemented.\n",
340 lpszName,
341 fdwConnection,
342 fForce));
343
344 return (ERROR_NOT_CONNECTED);
345}
346
347
348/*****************************************************************************
349 * Name : DWORD WIN32API WNetCancelConnectionA
350 * Purpose : The WNetCancelConnection2 function breaks an existing network
351 * connection.
352 * Parameters: LPTSTR lpszName address of resource name to disconnect
353 * BOOL fForce flag for unconditional disconnect
354 * Variables :
355 * Result : API-Returncode
356 * Remark :
357 * Status : UNTESTED STUB
358 *
359 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
360 *****************************************************************************/
361
362DWORD WIN32API OS2WNetCancelConnectionA(LPTSTR lpszName,
363 BOOL fForce)
364{
365 dprintf(("MPR:WNetCancelConnectionA (%s,%08x,%u) not implemented.\n",
366 lpszName,
367 fForce));
368
369 return (ERROR_NOT_CONNECTED);
370}
371
372
373/*****************************************************************************
374 * Name : DWORD WIN32API WNetCancelConnectionW
375 * Purpose : The WNetCancelConnection2 function breaks an existing network
376 * connection.
377 * Parameters: LPTSTR lpszName address of resource name to disconnect
378 * BOOL fForce flag for unconditional disconnect
379 * Variables :
380 * Result : API-Returncode
381 * Remark :
382 * Status : UNTESTED STUB
383 *
384 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
385 *****************************************************************************/
386
387DWORD WIN32API OS2WNetCancelConnectionW(LPWSTR lpszName,
388 BOOL fForce)
389{
390 dprintf(("MPR:WNetCancelConnectionW (%s,%08x,%u) not implemented.\n",
391 lpszName,
392 fForce));
393
394 return (ERROR_NOT_CONNECTED);
395}
396
397
398/*****************************************************************************
399 * Name : DWORD WIN32API WNetCloseEnum
400 * Purpose : The WNetCloseEnum function ends a network resource enumeration
401 * started by the WNetOpenEnum function.
402 * Parameters: HANDLE hEnum
403 * Variables :
404 * Result : API-Returncode
405 * Remark :
406 * Status : UNTESTED STUB
407 *
408 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
409 *****************************************************************************/
410
411DWORD WIN32API OS2WNetCloseEnum (HANDLE hEnum)
412{
413 dprintf(("MPR:WNetCloseEnum (%08x) not implemented.\n",
414 hEnum));
415
416 return (ERROR_NO_NETWORK);
417}
418
419
420/*****************************************************************************
421 * Name : DWORD WIN32API WNetConnectionDialog
422 * Purpose : The WNetConnectionDialog function starts a general browsing
423 * dialog box for connecting to network resources.
424 * Parameters: HWND hwnd handle of window owning dialog box
425 * DWORD fdwResourceType resource type to allow connections to
426 * Variables :
427 * Result : API-Returncode
428 * Remark :
429 * Status : UNTESTED STUB
430 *
431 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
432 *****************************************************************************/
433
434DWORD WIN32API OS2WNetConnectionDialog (HWND hwnd,
435 DWORD fdwResourceType)
436{
437 dprintf(("MPR:WNetConnectionDialog (%08x,%08x) not implemented.\n",
438 hwnd,
439 fdwResourceType));
440
441 return (ERROR_NO_NETWORK);
442}
443
444
445/*****************************************************************************
446 * Name : DWORD WIN32API WNetDisconnectDialog
447 * Purpose : The WNetDisconnectDialog function starts a general browsing
448 * dialog box for disconnecting from network resources.
449 * Parameters: HWND hwnd handle of window owning dialog box
450 * DWORD fdwResourceType resource type to disconnect from
451 * Variables :
452 * Result : API-Returncode
453 * Remark :
454 * Status : UNTESTED STUB
455 *
456 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
457 *****************************************************************************/
458
459DWORD WIN32API OS2WNetDisconnectDialog (HWND hwnd,
460 DWORD fdwResourceType)
461{
462 dprintf(("MPR:WNetDisconnectDialog (%08x,%08x) not implemented.\n",
463 hwnd,
464 fdwResourceType));
465
466 return (ERROR_NO_NETWORK);
467}
468
469
470/*****************************************************************************
471 * Name : DWORD WIN32API WNetEnumResourceA
472 * Purpose : The WNetEnumResource function continues a network-resource
473 * enumeration started by the WNetOpenEnum function.
474 * Parameters: HANDLE hEnum handle of enumeration
475 * LPDWORD lpcEntries address of entries to list
476 * LPVOID lpvBuffer address of buffer for results
477 * LPDWORD lpcbBuffer address of buffer size variable
478 * Variables :
479 * Result : API-Returncode
480 * Remark :
481 * Status : UNTESTED STUB
482 *
483 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
484 *****************************************************************************/
485
486DWORD WIN32API OS2WNetEnumResourceA (HANDLE hEnum,
487 LPDWORD lpcEntries,
488 LPVOID lpvBuffer,
489 LPDWORD lpcBuffer)
490{
491 dprintf(("MPR:WNetEnumResourceA (%08x,%08x,%08x,%08x) not implemented.\n",
492 hEnum,
493 lpcEntries,
494 lpvBuffer,
495 lpcBuffer));
496
497 return (ERROR_NO_NETWORK);
498}
499
500
501/*****************************************************************************
502 * Name : DWORD WIN32API WNetEnumResourceW
503 * Purpose : The WNetEnumResource function continues a network-resource
504 * enumeration started by the WNetOpenEnum function.
505 * Parameters: HANDLE hEnum handle of enumeration
506 * LPDWORD lpcEntries address of entries to list
507 * LPVOID lpvBuffer address of buffer for results
508 * LPDWORD lpcbBuffer address of buffer size variable
509 * Variables :
510 * Result : API-Returncode
511 * Remark :
512 * Status : UNTESTED STUB
513 *
514 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
515 *****************************************************************************/
516
517DWORD WIN32API OS2WNetEnumResourceW (HANDLE hEnum,
518 LPDWORD lpcEntries,
519 LPVOID lpvBuffer,
520 LPDWORD lpcBuffer)
521{
522 dprintf(("MPR:WNetEnumResourceW (%08x,%08x,%08x,%08x) not implemented.\n",
523 hEnum,
524 lpcEntries,
525 lpvBuffer,
526 lpcBuffer));
527
528 return (ERROR_NO_NETWORK);
529}
530
531
532/*****************************************************************************
533 * Name : DWORD WIN32API WNetGetConnectionA
534 * Purpose : The WNetGetConnection function retrieves the name of the network
535 * resource associated with a local device.
536 * Parameters: LPTSTR lpszLocalName address of local name
537 * LPTSTR lpszRemoteName address of buffer for remote name
538 * LPDWORD lpcchBuffer address of buffer size, in characters
539 * Variables :
540 * Result : API-Returncode
541 * Remark :
542 * Status : UNTESTED STUB
543 *
544 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
545 *****************************************************************************/
546
547DWORD WIN32API OS2WNetGetConnectionA (LPTSTR lpszLocalName,
548 LPTSTR lpszRemoteName,
549 LPDWORD lpcchBuffer)
550{
551 dprintf(("MPR:WNetGetConnectionA (%s,%s,%08x) not implemented.\n",
552 lpszLocalName,
553 lpszRemoteName,
554 lpcchBuffer));
555
556 return (ERROR_NO_NETWORK);
557}
558
559
560/*****************************************************************************
561 * Name : DWORD WIN32API WNetGetConnectionW
562 * Purpose : The WNetGetConnection function retrieves the name of the network
563 * resource associated with a local device.
564 * Parameters: LPWSTR lpszLocalName address of local name
565 * LPWSTR lpszRemoteName address of buffer for remote name
566 * LPDWORD lpcchBuffer address of buffer size, in characters
567 * Variables :
568 * Result : API-Returncode
569 * Remark :
570 * Status : UNTESTED STUB
571 *
572 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
573 *****************************************************************************/
574
575DWORD WIN32API OS2WNetGetConnectionW (LPWSTR lpszLocalName,
576 LPWSTR lpszRemoteName,
577 LPDWORD lpcchBuffer)
578{
579 dprintf(("MPR:WNetGetConnectionW (%s,%s,%08x) not implemented.\n",
580 lpszLocalName,
581 lpszRemoteName,
582 lpcchBuffer));
583
584 return (ERROR_NO_NETWORK);
585}
586
587
588/*****************************************************************************
589 * Name : DWORD WIN32API WNetGetLastErrorA
590 * Purpose : The WNetGetLastError function retrieves the most recent extended
591 * error code set by a Windows network function.
592 * Parameters: LPDWORD lpdwErrorCode address of error code
593 * LPTSTR lpszDescription address of string describing error
594 * DWORD cchDescription size of description buffer, in characters
595 * LPTSTR lpszName address of buffer for provider name
596 * DWORD cchName size of provider name buffer
597 * Variables :
598 * Result : API-Returncode
599 * Remark :
600 * Status : UNTESTED STUB
601 *
602 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
603 *****************************************************************************/
604
605DWORD WIN32API OS2WNetGetLastErrorA (LPDWORD lpdwErrorCode,
606 LPTSTR lpszDescription,
607 DWORD cchDescription,
608 LPTSTR lpszName,
609 DWORD cchName)
610{
611 dprintf(("MPR:WNetGetLastErrorA (%08x,%08x,%08x,%08x,%80x).\n",
612 lpdwErrorCode,
613 lpszDescription,
614 cchDescription,
615 lpszName,
616 cchName));
617
618 if ( (lpdwErrorCode == NULL) || /* check parameters */
619 (lpszDescription == NULL) ||
620 (cchDescription == 0) ||
621 (lpszName == NULL) ||
622 (cchName == 0) )
623 return (ERROR_INVALID_ADDRESS); /* abort with error */
624
625 *lpdwErrorCode = MPRGLOBALS.dwLastError; /* set that error code */
626 /* @@@PH Get error text from some net-MSG-file */
627 lpszDescription[cchDescription - 1] = 0; /* ensure string termination */
628
629 strncpy (lpszName, /* return provider name */
630 "OS/2 LAN", /* that's our default provider */
631 cchName);
632 lpszName[cchName - 1] = 0; /* ensure string termination */
633
634 return (NO_ERROR);
635}
636
637
638
639/*****************************************************************************
640 * Name : DWORD WIN32API WNetGetLastErrorW
641 * Purpose : The WNetGetLastError function retrieves the most recent extended
642 * error code set by a Windows network function.
643 * Parameters: LPDWORD lpdwErrorCode address of error code
644 * LPWSTR lpszDescription address of string describing error
645 * DWORD cchDescription size of description buffer, in characters
646 * LPWSTR lpszName address of buffer for provider name
647 * DWORD cchName size of provider name buffer
648 * Variables :
649 * Result : API-Returncode
650 * Remark :
651 * Status : UNTESTED STUB
652 *
653 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
654 *****************************************************************************/
655
656DWORD WIN32API OS2WNetGetLastErrorW (LPDWORD lpdwErrorCode,
657 LPWSTR lpszDescription,
658 DWORD cchDescription,
659 LPWSTR lpszName,
660 DWORD cchName)
661{
662 dprintf(("MPR:WNetGetLastErrorA (%08x,%08x,%08x,%08x,%80x) not correctly implemented.\n",
663 lpdwErrorCode,
664 lpszDescription,
665 cchDescription,
666 lpszName,
667 cchName));
668
669 if ( (lpdwErrorCode == NULL) || /* check parameters */
670 (lpszDescription == NULL) ||
671 (cchDescription == 0) ||
672 (lpszName == NULL) ||
673 (cchName == 0) )
674 return (ERROR_INVALID_ADDRESS); /* abort with error */
675
676 *lpdwErrorCode = MPRGLOBALS.dwLastError; /* set that error code */
677 /* @@@PH Get error text from some net-MSG-file */
678 lpszDescription[cchDescription - 1] = 0; /* ensure string termination */
679
680 strncpy ((LPTSTR)lpszName, /* return provider name */
681 "OS/2 LAN", /* that's our default provider */
682 cchName);
683 lpszName[cchName - 1] = 0; /* ensure string termination */
684
685 return (NO_ERROR);
686}
687
688
689/*****************************************************************************
690 * Name : DWORD WIN32API WNetGetResourceInformationA
691 * Purpose : The WNetGetResourceInformation function retrieves enumeration
692 * information for a network resource. You typically use this
693 * function when the user specifies an object. Call this function
694 * in conjunction with WNetGetResourceParent to determine the
695 * placement and nature of the resource in the browse hierarchy.
696 * Unlike WNetGetResourceParent, WNetGetResourceInformation always
697 * tries to determine the network provider that owns the resource
698 * and the type of the resource, although it might not currently
699 * be accessible (or even exist if the type of the resource was
700 * specified by the caller).
701 * Parameters: LPNETRESOURCEA lpNetResource specifies the network resource
702 * LPVOID lpBuffer pointer to a buffer for results
703 * LPDWORD cbBuffer size of the buffer
704 * LPTSTR *lplpSystem pointer to a string in the buffer
705 * Variables :
706 * Result : API-Returncode
707 * Remark :
708 * Status : UNTESTED STUB
709 *
710 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
711 *****************************************************************************/
712
713DWORD WIN32API OS2WNetGetResourceInformationA(LPNETRESOURCEA lpNetResource,
714 LPVOID lpBuffer,
715 LPDWORD cbBuffer,
716 LPTSTR *lplpSystem)
717{
718 dprintf(("MPR:WNetGetResourceInformationA (%08x,%08x,%08x,%08x) not implemented.\n",
719 lpNetResource,
720 lpBuffer,
721 cbBuffer,
722 lplpSystem));
723
724 return (WN_NO_NETWORK);
725}
726
727
728/*****************************************************************************
729 * Name : DWORD WIN32API WNetGetResourceInformationW
730 * Purpose : The WNetGetResourceInformation function retrieves enumeration
731 * information for a network resource. You typically use this
732 * function when the user specifies an object. Call this function
733 * in conjunction with WNetGetResourceParent to determine the
734 * placement and nature of the resource in the browse hierarchy.
735 * Unlike WNetGetResourceParent, WNetGetResourceInformation always
736 * tries to determine the network provider that owns the resource
737 * and the type of the resource, although it might not currently
738 * be accessible (or even exist if the type of the resource was
739 * specified by the caller).
740 * Parameters: LPNETRESOURCEW lpNetResource specifies the network resource
741 * LPVOID lpBuffer pointer to a buffer for results
742 * LPDWORD cbBuffer size of the buffer
743 * LPWSTR *lplpSystem pointer to a string in the buffer
744 * Variables :
745 * Result : API-Returncode
746 * Remark :
747 * Status : UNTESTED STUB
748 *
749 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
750 *****************************************************************************/
751
752DWORD WIN32API OS2WNetGetResourceInformationW(LPNETRESOURCEW lpNetResource,
753 LPVOID lpBuffer,
754 LPDWORD cbBuffer,
755 LPWSTR *lplpSystem)
756{
757 dprintf(("MPR:WNetGetResourceInformationW (%08x,%08x,%08x,%08x) not implemented.\n",
758 lpNetResource,
759 lpBuffer,
760 cbBuffer,
761 lplpSystem));
762
763 return (WN_NO_NETWORK);
764}
765
766
767/*****************************************************************************
768 * Name : DWORD WIN32API WNetGetResourceParentA
769 * Purpose : The WNetGetResourceParent function lets you navigate up from a
770 * resource. It enables browsing to commence based on the name of
771 * a network resource. This function also allows navigating up from
772 * a browsed resource to find connectable resources.
773 * Parameters: LPNETRESOURCEA lpNetResource specifies the network resource
774 * LPVOID lpBuffer pointer to a buffer for results
775 * LPDWORD lpBufferSize size, in bytes, of the buffer
776 * Variables :
777 * Result : API-Returncode
778 * Remark :
779 * Status : UNTESTED STUB
780 *
781 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
782 *****************************************************************************/
783
784DWORD WIN32API OS2WNetGetResourceParentA(LPNETRESOURCEA lpNetResource,
785 LPVOID lpBuffer,
786 LPDWORD lpBufferSize)
787{
788 dprintf(("MPR:WNetGetResourceParentA (%08x,%08x,%u) not implemented.\n",
789 lpNetResource,
790 lpBuffer,
791 lpBufferSize));
792
793 return (WN_ACCESS_DENIED);
794}
795
796
797/*****************************************************************************
798 * Name : DWORD WIN32API WNetGetResourceParentW
799 * Purpose : The WNetGetResourceParent function lets you navigate up from a
800 * resource. It enables browsing to commence based on the name of
801 * a network resource. This function also allows navigating up from
802 * a browsed resource to find connectable resources.
803 * Parameters: LPNETRESOURCEW lpNetResource specifies the network resource
804 * LPVOID lpBuffer pointer to a buffer for results
805 * LPDWORD lpBufferSize size, in bytes, of the buffer
806 * Variables :
807 * Result : API-Returncode
808 * Remark :
809 * Status : UNTESTED STUB
810 *
811 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
812 *****************************************************************************/
813
814DWORD WIN32API OS2WNetGetResourceParentW(LPNETRESOURCEW lpNetResource,
815 LPVOID lpBuffer,
816 LPDWORD lpBufferSize)
817{
818 dprintf(("MPR:WNetGetResourceParentW (%08x,%08x,%u) not implemented.\n",
819 lpNetResource,
820 lpBuffer,
821 lpBufferSize));
822
823 return (WN_ACCESS_DENIED);
824}
825
826
827/*****************************************************************************
828 * Name : DWORD WIN32API WNetGetUniversalNameA
829 * Purpose : The WNetGetUniversalName function takes a drive-based path for
830 * a network resource and obtains a data structure that contains a
831 * more universal form of the name.
832 * Parameters: LPCSTR lpLocalPath address of drive-based path for a network resource
833 * DWORD dwInfoLevel specifies form of universal name to be obtained
834 * LPVOID lpBuffer address of buffer that receives universal name data structure
835 * LPDWORD lpBufferSize address of variable that specifies size of buffer
836 * Variables :
837 * Result : API-Returncode
838 * Remark :
839 * Status : UNTESTED STUB
840 *
841 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
842 *****************************************************************************/
843
844DWORD WIN32API OS2WNetGetUniversalNameA(LPCSTR lpLocalPath,
845 DWORD dwInfoLevel,
846 LPVOID lpBuffer,
847 LPDWORD lpBufferSize)
848{
849 dprintf(("MPR:WNetGetUniversalNameA (%s,%08x,%08x,%08x) not implemented.\n",
850 lpLocalPath,
851 dwInfoLevel,
852 lpBuffer,
853 lpBufferSize));
854
855 return (ERROR_NO_NETWORK);
856}
857
858
859/*****************************************************************************
860 * Name : DWORD WIN32API WNetGetUniversalNameW
861 * Purpose : The WNetGetUniversalName function takes a drive-based path for
862 * a network resource and obtains a data structure that contains a
863 * more universal form of the name.
864 * Parameters: LPCWSTR lpLocalPath address of drive-based path for a network resource
865 * DWORD dwInfoLevel specifies form of universal name to be obtained
866 * LPVOID lpBuffer address of buffer that receives universal name data structure
867 * LPDWORD lpBufferSize address of variable that specifies size of buffer
868 * Variables :
869 * Result : API-Returncode
870 * Remark :
871 * Status : UNTESTED STUB
872 *
873 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
874 *****************************************************************************/
875
876DWORD WIN32API OS2WNetGetUniversalNameW(LPCWSTR lpLocalPath,
877 DWORD dwInfoLevel,
878 LPVOID lpBuffer,
879 LPDWORD lpBufferSize)
880{
881 dprintf(("MPR:WNetGetUniversalNameW (%s,%08x,%08x,%08x) not implemented.\n",
882 lpLocalPath,
883 dwInfoLevel,
884 lpBuffer,
885 lpBufferSize));
886
887 return (ERROR_NO_NETWORK);
888}
889
890
891/*****************************************************************************
892 * Name : DWORD WIN32API WNetGetUserA
893 * Purpose : The WNetGetUser function retrieves the current default user name
894 * or the user name used to establish a network connection.
895 * Parameters: LPTSTR lpszLocalName address of local name to get user name for
896 * LPTSTR lpszUserName address of buffer for user name
897 * LPDWORD lpcchBuffer address of buffer size variable
898 * Variables :
899 * Result : API-Returncode
900 * Remark :
901 * Status : UNTESTED STUB
902 *
903 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
904 *****************************************************************************/
905
906DWORD WIN32API OS2WNetGetUserA(LPTSTR lpszLocalName,
907 LPTSTR lpszUserName,
908 LPDWORD lpcchBuffer)
909{
910 dprintf(("MPR:WNetGetUserA (%s,%s,%08x) not implemented.\n",
911 lpszLocalName,
912 lpszUserName,
913 lpcchBuffer));
914
915 return (ERROR_NO_NETWORK);
916}
917
918
919/*****************************************************************************
920 * Name : DWORD WIN32API WNetGetUserW
921 * Purpose : The WNetGetUser function retrieves the current default user name
922 * or the user name used to establish a network connection.
923 * Parameters: LPWSTR lpszLocalName address of local name to get user name for
924 * LPWSTR lpszUserName address of buffer for user name
925 * LPDWORD lpcchBuffer address of buffer size variable
926 * Variables :
927 * Result : API-Returncode
928 * Remark :
929 * Status : UNTESTED STUB
930 *
931 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
932 *****************************************************************************/
933
934DWORD WIN32API OS2WNetGetUserW(LPWSTR lpszLocalName,
935 LPWSTR lpszUserName,
936 LPDWORD lpcchBuffer)
937{
938 dprintf(("MPR:WNetGetUserW (%s,%s,%08x) not implemented.\n",
939 lpszLocalName,
940 lpszUserName,
941 lpcchBuffer));
942
943 return (ERROR_NO_NETWORK);
944}
945
946
947/*****************************************************************************
948 * Name : DWORD WIN32API WNetOpenEnumA
949 * Purpose : The WNetOpenEnum function starts an enumeration of network
950 * resources or existing connections.
951 * Parameters: DWORD fdwScope scope of enumeration
952 * DWORD fdwType resource types to list
953 * DWORD fdwUsage resource usage to list
954 * LPNETRESOURCEA lpNetResource address of resource structure
955 * LPHANDLE lphEnum address of enumeration handle buffer
956 * Variables :
957 * Result : API-Returncode
958 * Remark :
959 * Status : UNTESTED STUB
960 *
961 * Author : Patrick Haller [Fri, 1998/02/27 14:41]
962 *****************************************************************************/
963
964DWORD WIN32API OS2WNetOpenEnumA(DWORD fdwScope,
965 DWORD fdwType,
966 DWORD fdwUsage,
967 LPNETRESOURCEA lpNetResource,
968 LPHANDLE lphEnum)
969{
970 dprintf(("MPR:WNetOpenEnumA (%08x,%08x,%08x,%08x,%08x) not implemented.\n",
971 fdwScope,
972 fdwType,
973 fdwUsage,
974 lpNetResource,
975 lphEnum));
976
977 return (ERROR_NO_NETWORK);
978}
979
980
981/*****************************************************************************
982 * Name : DWORD WIN32API WNetOpenEnumW
983 * Purpose : The WNetOpenEnum function starts an enumeration of network
984 * resources or existing connections.
985 * Parameters: DWORD fdwScope scope of enumeration
986 * DWORD fdwType resource types to list
987 * DWORD fdwUsage resource usage to list
988 * LPNETRESOURCEW lpNetResource address of resource structure
989 * LPHANDLE lphEnum address of enumeration handle buffer
990 * Variables :
991 * Result : API-Returncode
992 * Remark :
993 * Status : UNTESTED STUB
994 *
995 * Author : Patrick Haller [Fri, 1998/02/27 14:41]
996 *****************************************************************************/
997
998DWORD WIN32API OS2WNetOpenEnumW(DWORD fdwScope,
999 DWORD fdwType,
1000 DWORD fdwUsage,
1001 LPNETRESOURCEW lpNetResource,
1002 LPHANDLE lphEnum)
1003{
1004 dprintf(("MPR:WNetOpenEnumW (%08x,%08x,%08x,%08x,%08x) not implemented.\n",
1005 fdwScope,
1006 fdwType,
1007 fdwUsage,
1008 lpNetResource,
1009 lphEnum));
1010
1011 return (ERROR_NO_NETWORK);
1012}
1013
1014
1015/*****************************************************************************
1016 * Name : DWORD WIN32API WNetSetLastErrorA
1017 * Purpose : The WNetSetLastError function is used to set the error code status
1018 * of this module.
1019 * Parameters: DWORD dwErrorCode error code
1020 * LPTSTR lpszDescription address of string describing error
1021 * LPTSTR lpszName address of buffer for provider name
1022 * Variables :
1023 * Result : API-Returncode
1024 * Remark : not documented
1025 * Status : UNTESTED
1026 *
1027 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
1028 *****************************************************************************/
1029
1030DWORD WIN32API OS2WNetSetLastErrorA (DWORD dwErrorCode,
1031 LPTSTR lpszDescription,
1032 LPTSTR lpszName)
1033{
1034 dprintf(("MPR:WNetSetLastErrorA (%08x,%s,%s) not implemented correctly.\n",
1035 dwErrorCode,
1036 lpszDescription,
1037 lpszName));
1038
1039 MPRGLOBALS.dwLastError = dwErrorCode;
1040
1041 return (NO_ERROR);
1042}
1043
1044
1045
1046/*****************************************************************************
1047 * Name : DWORD WIN32API WNetSetLastErrorW
1048 * Purpose : The WNetSetLastError function is used to set the error code status
1049 * of this module.
1050 * Parameters: DWORD dwErrorCode error code
1051 * LPWSTR lpszDescription address of string describing error
1052 * LPWSTR lpszName address of buffer for provider name
1053 * Variables :
1054 * Result : API-Returncode
1055 * Remark : not documented
1056 * Status : UNTESTED
1057 *
1058 * Author : Patrick Haller [Fri, 1998/02/27 11:55]
1059 *****************************************************************************/
1060
1061DWORD WIN32API OS2WNetSetLastErrorW (DWORD dwErrorCode,
1062 LPWSTR lpszDescription,
1063 LPWSTR lpszName)
1064{
1065 dprintf(("MPR:WNetSetLastErrorW (%08x,%s,%s) not implemented correctly.\n",
1066 dwErrorCode,
1067 lpszDescription,
1068 lpszName));
1069
1070 MPRGLOBALS.dwLastError = dwErrorCode;
1071
1072 return (NO_ERROR);
1073}
1074
Note: See TracBrowser for help on using the repository browser.