| 1 | /* $Id: dosdevice.cpp,v 1.1 2001-11-29 10:31:07 phaller Exp $ | 
|---|
| 2 | * | 
|---|
| 3 | * Win32 Kernel Symbolic Link Subsystem for OS/2 | 
|---|
| 4 | * | 
|---|
| 5 | * 2001/11/29 Patrick Haller <patrick.haller@innotek.de> | 
|---|
| 6 | * | 
|---|
| 7 | * Project Odin Software License can be found in LICENSE.TXT | 
|---|
| 8 | * | 
|---|
| 9 | */ | 
|---|
| 10 |  | 
|---|
| 11 | /* To Do: | 
|---|
| 12 | * - implement both APIs using the HandleNames symbolic link resolver | 
|---|
| 13 | */ | 
|---|
| 14 |  | 
|---|
| 15 |  | 
|---|
| 16 | /***************************************************************************** | 
|---|
| 17 | * Includes                                                                  * | 
|---|
| 18 | *****************************************************************************/ | 
|---|
| 19 | #include <os2win.h> | 
|---|
| 20 | #include <winnls.h> | 
|---|
| 21 | #include "unicode.h" | 
|---|
| 22 | #include "handlemanager.h" | 
|---|
| 23 | #include "handlenames.h" | 
|---|
| 24 | #include <string.h> | 
|---|
| 25 |  | 
|---|
| 26 |  | 
|---|
| 27 | /***************************************************************************** | 
|---|
| 28 | * Defines                                                                   * | 
|---|
| 29 | *****************************************************************************/ | 
|---|
| 30 |  | 
|---|
| 31 |  | 
|---|
| 32 | // For DefineDosDevice | 
|---|
| 33 |  | 
|---|
| 34 | #define DDD_RAW_TARGET_PATH         0x00000001 | 
|---|
| 35 | #define DDD_REMOVE_DEFINITION       0x00000002 | 
|---|
| 36 | #define DDD_EXACT_MATCH_ON_REMOVE   0x00000004 | 
|---|
| 37 | #define DDD_NO_BROADCAST_SYSTEM     0x00000008 | 
|---|
| 38 |  | 
|---|
| 39 |  | 
|---|
| 40 |  | 
|---|
| 41 | /***************************************************************************** | 
|---|
| 42 | * Name      : BOOL WIN32API DefineDosDeviceA | 
|---|
| 43 | * Purpose   : The DefineDosDeviceA function lets an application define, | 
|---|
| 44 | *             redefine, or delete MS-DOS device names. | 
|---|
| 45 | *             MS-DOS device names are stored as symbolic links in the object | 
|---|
| 46 | *             name space in 32-bit versions of Windows. The code that converts | 
|---|
| 47 | *             an MS-DOS path into a corresponding path in 32-bit versions of | 
|---|
| 48 | *             Windows uses these symbolic links to map MS-DOS devices and drive | 
|---|
| 49 | *             letters. The DefineDosDevice function provides a mechanism | 
|---|
| 50 | *             whereby a Win32-based application can modify the symbolic links | 
|---|
| 51 | *             used to implement the MS-DOS device name space. | 
|---|
| 52 | * Parameters: DWORD dwFlags         flags specifying aspects of device definition | 
|---|
| 53 | *             LPCSTR lpDeviceName   pointer to MS-DOS device name string | 
|---|
| 54 | *             LPCSTR lpTargetPath   pointer to MS-DOS or path string for | 
|---|
| 55 | *                                   32-bit Windows | 
|---|
| 56 | * Variables : | 
|---|
| 57 | * Result    : If the function succeeds, the return value is nonzero. | 
|---|
| 58 | *             If the function fails, the return value is zero | 
|---|
| 59 | * Remark    : | 
|---|
| 60 | * Status    : UNTESTED STUB | 
|---|
| 61 | * | 
|---|
| 62 | * Author    : Markus Montkowski [Tha, 1998/05/21 17:46] | 
|---|
| 63 | *****************************************************************************/ | 
|---|
| 64 |  | 
|---|
| 65 | BOOL WIN32API DefineDosDeviceA( DWORD dwFlags, LPCSTR lpDeviceName, | 
|---|
| 66 | LPCSTR lpTargetPath  ) | 
|---|
| 67 | { | 
|---|
| 68 |  | 
|---|
| 69 | dprintf(("KERNEL32: DefineDosDeviceA(%08x,%08x,%08x) not implemented\n", | 
|---|
| 70 | dwFlags,  lpDeviceName, lpTargetPath | 
|---|
| 71 | )); | 
|---|
| 72 |  | 
|---|
| 73 | return (FALSE); | 
|---|
| 74 | } | 
|---|
| 75 |  | 
|---|
| 76 | /***************************************************************************** | 
|---|
| 77 | * Name      : BOOL WIN32API DefineDosDeviceW | 
|---|
| 78 | * Purpose   : UNICODE version of DefineDosDeviceA | 
|---|
| 79 | * Parameters: DWORD dwFlags         flags specifying aspects of device definition | 
|---|
| 80 | *             LPCSTR lpDeviceName   pointer to MS-DOS device name string | 
|---|
| 81 | *             LPCSTR lpTargetPath   pointer to MS-DOS or path string for | 
|---|
| 82 | *                                   32-bit Windows | 
|---|
| 83 | * Variables : | 
|---|
| 84 | * Result    : If the function succeeds, the return value is nonzero. | 
|---|
| 85 | *             If the function fails, the return value is zero | 
|---|
| 86 | * Remark    : | 
|---|
| 87 | * Status    : UNTESTED STUB | 
|---|
| 88 | * | 
|---|
| 89 | * Author    : Markus Montkowski [Tha, 1998/05/21 17:46] | 
|---|
| 90 | *****************************************************************************/ | 
|---|
| 91 |  | 
|---|
| 92 | BOOL WIN32API DefineDosDeviceW( DWORD dwFlags, LPCWSTR lpDeviceName, | 
|---|
| 93 | LPCWSTR lpTargetPath ) | 
|---|
| 94 | { | 
|---|
| 95 |  | 
|---|
| 96 | dprintf(("KERNEL32: DefineDosDeviceW(%08x,%08x,%08x) not implemented\n", | 
|---|
| 97 | dwFlags,  lpDeviceName, lpTargetPath | 
|---|
| 98 | )); | 
|---|
| 99 |  | 
|---|
| 100 | return (FALSE); | 
|---|
| 101 | } | 
|---|
| 102 |  | 
|---|
| 103 |  | 
|---|
| 104 | /***************************************************************************** | 
|---|
| 105 | * Name      : DWORD QueryDosDeviceA | 
|---|
| 106 | * Purpose   : The QueryDosDevice function lets an application obtain information | 
|---|
| 107 | *             about MS-DOS device names. The function can obtain the current | 
|---|
| 108 | *             mapping for a particular MS-DOS device name. The function can also | 
|---|
| 109 | *             obtain a list of all existing MS-DOS device names. | 
|---|
| 110 | *             MS-DOS device names are stored as symbolic links in the Windows NT | 
|---|
| 111 | *             object name space. The code that converts an MS-DOS path into a | 
|---|
| 112 | *             corresponding Windows NT path uses these symbolic links to map | 
|---|
| 113 | *             MS-DOS devices and drive letters. The QueryDosDevice function | 
|---|
| 114 | *             provides a mechanism whereby a Win32-based application can query | 
|---|
| 115 | *             the names of the symbolic links used to implement the MS-DOS device | 
|---|
| 116 | *             namespace as well as the value of each specific symbolic link. | 
|---|
| 117 | * Parameters: LPCTSTR lpDeviceName address of MS-DOS device name string | 
|---|
| 118 | *             LPTSTR  lpTargetPath ddress of buffer for storing query results | 
|---|
| 119 | *             DWORD   ucchMax       maximum storage capacity of buffer | 
|---|
| 120 | * Variables : | 
|---|
| 121 | * Result    : pointer to lpTargetPath | 
|---|
| 122 | * Remark    : | 
|---|
| 123 | * Status    : UNTESTED STUB | 
|---|
| 124 | * | 
|---|
| 125 | * Author    : Patrick Haller [Mon, 1998/06/15 08:00] | 
|---|
| 126 | *****************************************************************************/ | 
|---|
| 127 |  | 
|---|
| 128 | DWORD WIN32API QueryDosDeviceA(LPCTSTR lpDeviceName, | 
|---|
| 129 | LPTSTR  lpTargetPath, | 
|---|
| 130 | DWORD   ucchMax) | 
|---|
| 131 | { | 
|---|
| 132 | dprintf(("Kernel32: QueryDosDeviceA(%s,%08xh,%08xh) not implemented.\n", | 
|---|
| 133 | lpDeviceName, | 
|---|
| 134 | lpTargetPath, | 
|---|
| 135 | ucchMax)); | 
|---|
| 136 |  | 
|---|
| 137 | return (0); | 
|---|
| 138 | } | 
|---|
| 139 |  | 
|---|
| 140 |  | 
|---|
| 141 | /***************************************************************************** | 
|---|
| 142 | * Name      : DWORD QueryDosDeviceW | 
|---|
| 143 | * Purpose   : The QueryDosDevice function lets an application obtain information | 
|---|
| 144 | *             about MS-DOS device names. The function can obtain the current | 
|---|
| 145 | *             mapping for a particular MS-DOS device name. The function can also | 
|---|
| 146 | *             obtain a list of all existing MS-DOS device names. | 
|---|
| 147 | *             MS-DOS device names are stored as symbolic links in the Windows NT | 
|---|
| 148 | *             object name space. The code that converts an MS-DOS path into a | 
|---|
| 149 | *             corresponding Windows NT path uses these symbolic links to map | 
|---|
| 150 | *             MS-DOS devices and drive letters. The QueryDosDevice function | 
|---|
| 151 | *             provides a mechanism whereby a Win32-based application can query | 
|---|
| 152 | *             the names of the symbolic links used to implement the MS-DOS device | 
|---|
| 153 | *             namespace as well as the value of each specific symbolic link. | 
|---|
| 154 | * Parameters: LPCTSTR lpDeviceName address of MS-DOS device name string | 
|---|
| 155 | *             LPTSTR  lpTargetPath ddress of buffer for storing query results | 
|---|
| 156 | *             DWORD   ucchMax       maximum storage capacity of buffer | 
|---|
| 157 | * Variables : | 
|---|
| 158 | * Result    : pointer to lpTargetPath | 
|---|
| 159 | * Remark    : | 
|---|
| 160 | * Status    : UNTESTED STUB | 
|---|
| 161 | * | 
|---|
| 162 | * Author    : Patrick Haller [Mon, 1998/06/15 08:00] | 
|---|
| 163 | *****************************************************************************/ | 
|---|
| 164 |  | 
|---|
| 165 | DWORD WIN32API QueryDosDeviceW(LPCWSTR lpDeviceName, | 
|---|
| 166 | LPWSTR  lpTargetPath, | 
|---|
| 167 | DWORD   ucchMax) | 
|---|
| 168 | { | 
|---|
| 169 | dprintf(("Kernel32: QueryDosDeviceW(%s,%08xh,%08xh) not implemented.\n", | 
|---|
| 170 | lpDeviceName, | 
|---|
| 171 | lpTargetPath, | 
|---|
| 172 | ucchMax)); | 
|---|
| 173 |  | 
|---|
| 174 | return (0); | 
|---|
| 175 | } | 
|---|