- Timestamp:
- Aug 31, 2001, 1:37:03 AM (24 years ago)
- Location:
- trunk/src/shlwapi
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shlwapi/ordinal.c
r6608 r6609 68 68 */ 69 69 DWORD WINAPI SHLWAPI_1 ( 70 LPSTR lpString1,71 LP STR lpString2)72 { 73 if (lp String1== NULL)74 return 0;70 LPSTR lpURL, 71 LPDWORD lpdwFlags) 72 { 73 if (lpURL == NULL) 74 return E_INVALIDARG; 75 75 76 if (lpString2 == NULL) 77 return 0; 76 if (lpdwFlags == NULL) 77 return E_INVALIDARG; 78 79 // verify flags 80 if (*lpdwFlags != 0x18) // some unknown flag 81 return E_INVALIDARG; // some unknown error condition 78 82 79 83 FIXME("(%p %s %p %s)\n",lpStr, debugstr_a(lpStr),x, debugstr_a(x)); -
trunk/src/shlwapi/ordinal_odin.cpp
r5749 r6609 1 /* $Id: ordinal_odin.cpp,v 1. 2 2001-05-19 11:14:01 sandervlExp $ */1 /* $Id: ordinal_odin.cpp,v 1.3 2001-08-30 23:37:03 phaller Exp $ */ 2 2 3 3 /* … … 90 90 *****************************************************************************/ 91 91 92 ODINFUNCTION2(DWORD,SHLWAPI_1, 93 DWORD,arg0, 94 DWORD,arg1) 92 // return characters in protocol part 93 static INT extractProtocolFromURL(LPSTR pszURL, 94 LPSTR* ppszColon) 95 { 96 int i = 0; // number of characters scanned 97 LPSTR s = pszURL; 98 99 *ppszColon = NULL; 100 101 if (*pszURL == 0) 102 return 0; 103 104 105 // scan through the string for the 1st colon 106 while(*s) 107 { 108 // filter non-printable characters 109 if (*s < ' ') 110 return 0; 111 else 112 if (*s > 0x80) 113 return 0; 114 115 // Note: actually, the original code has a table with 116 // "forbidden" characters, we don't reproduce this here yet. 117 118 if (*s == ':') 119 { 120 // yes, first colon found! 121 if ( (pszURL[0] == 'U' || pszURL[0] == 'u') && 122 (pszURL[1] == 'R' || pszURL[1] == 'r') && 123 (pszURL[2] == 'L' || pszURL[2] == 'l') ) 124 { 125 // restart scan! 126 pszURL = s+1; 127 i = 0; 128 } 129 else 130 { 131 // OK, protocol extracted 132 *ppszColon = s; 133 return i; 134 } 135 } 136 137 // skip to next character 138 i++; 139 s++; 140 } 141 142 return 0; 143 } 144 145 typedef struct tabProtocolTableEntry 146 { 147 LPSTR pszName; // Note: original is unicode 148 DWORD ID; 149 DWORD dwNameLength; 150 DWORD dwCharacteristic; 151 } PROTOCOLTABLEENTRY, *LPPROTOCOLTABLEENTRY; 152 153 154 #define PROTOCOL_HTTP 2 155 #define PROTOCOL_FILE 9 156 157 static PROTOCOLTABLEENTRY tabProtocolTable[] = 158 { 159 { "http", PROTOCOL_HTTP, 4, 0x0a }, 160 { "file", PROTOCOL_FILE, 4, 0x08 }, 161 { "ftp", 1, 3, 0x0a }, 162 { "https", 11, 5, 0x0a }, 163 { "news", 5, 4, 0x0a }, 164 { "mailto", 0, 6, 0x01 }, 165 { "gopher", 3, 6, 0x0a }, 166 { "nntp", 6, 4, 0x0a }, 167 { "telnet", 7, 6, 0x0a }, 168 { "wais", 8, 4, 0x00 }, 169 { "mk", 10, 2, 0x04 }, 170 { "shell", 12, 5, 0x01 }, 171 { "local", 14, 5, 0x00 }, 172 { "javascript", 15, 10, 0x05 }, 173 { "vbscript", 16, 8, 0x05 }, 174 { "snews", 13, 5, 0x0a }, 175 { "about", 17, 5, 0x05 }, 176 { "res", 18, 3, 0x04 } 177 }; 178 #define END_OF_PROTOCOLTABLE (tabProtocolTable + sizeof(tabProtocolTable)) 179 180 181 182 static DWORD getProtocolTableEntry(LPSTR pszProtocol, DWORD dwNameLength) 183 { 184 LPPROTOCOLTABLEENTRY lpEntry = tabProtocolTable; 185 186 for(;;) 187 { 188 if (lpEntry->dwNameLength == dwNameLength) 189 if (lstrncmpiA( lpEntry->pszName, pszProtocol, dwNameLength) == 0) 190 { 191 return lpEntry->ID; 192 } 193 194 lpEntry++; 195 196 // if scanning beyond end of the table, 197 // abort and return null 198 if (lpEntry > END_OF_PROTOCOLTABLE) 199 return 0; 200 } 201 } 202 203 typedef struct tagProtocolHandlerA 204 { 205 DWORD dwSize; 206 DWORD dwProtocolNameLength; 207 LPSTR lpszProtocolName; 208 LPSTR lpszURL; 209 DWORD dwURLNameLength; 210 DWORD ProtocolID; 211 } PROTOCOLHANDLERA, *LPPROTOCOLHANDLERA; 212 213 typedef struct tagProtocolHandlerW 214 { 215 DWORD dwSize; 216 DWORD dwProtocolNameLength; 217 LPWSTR lpszProtocolName; 218 LPWSTR lpszURL; 219 DWORD dwURLNameLength; 220 DWORD ProtocolID; 221 } PROTOCOLHANDLERW, *LPPROTOCOLHANDLERW; 222 223 224 ODINFUNCTION2(DWORD, SHLWAPI_1, 225 LPSTR, lpszURL, 226 LPPROTOCOLHANDLERA, lpHandler) 95 227 { 96 228 dprintf(("not implemented")); 97 229 98 return 0; 99 } 100 101 102 /***************************************************************************** 103 * Name : ??? 104 * Purpose : Unknown (used by explorer.exe) 105 * Parameters: Unknown (wrong) 106 * Variables : 107 * Result : Unknown 108 * Remark : 109 * Status : UNTESTED STUB 110 * 111 * Author : Christoph Bratschi [Wed, 2000/03/29 19:47] 112 *****************************************************************************/ 113 114 ODINFUNCTION2(DWORD,SHLWAPI_2, 115 DWORD,arg0, 116 DWORD,arg1) 117 { 118 dprintf(("not implemented")); 230 if (NULL == lpszURL) 231 return E_INVALIDARG; 232 233 if (NULL == lpHandler) 234 return E_INVALIDARG; 235 236 if (lpHandler->dwSize != sizeof( PROTOCOLHANDLERA) ) 237 return E_INVALIDARG; 238 239 dprintf(("SHLWAPI-SHLWAPI1: URL=%s", 240 lpszURL)); 241 242 INT iProtocolLength = extractProtocolFromURL(lpszURL, 243 &lpszURL); 244 lpHandler->dwProtocolNameLength = iProtocolLength; 245 if (0 == iProtocolLength) 246 return 0x80041001; // unknown error constant 247 248 lpHandler->lpszProtocolName = lpszURL; 249 250 DWORD ID = getProtocolTableEntry(lpszURL, 251 iProtocolLength); 252 lpHandler->ProtocolID = ID; 253 lpHandler->lpszURL = (LPSTR)(lpszURL + iProtocolLength + 1); 254 255 if (ID == PROTOCOL_FILE) 256 { 257 // cut off leading slashes as required 258 if (lpHandler->lpszURL[0] == '/' && 259 lpHandler->lpszURL[1] == '/') 260 lpHandler->lpszURL = lpHandler->lpszURL + 2; 261 262 if (lpHandler->lpszURL[0] == '/') 263 lpHandler->lpszURL = lpHandler->lpszURL + 1; 264 } 265 266 lpHandler->dwURLNameLength = lstrlenA(lpHandler->lpszURL); 267 268 return NO_ERROR; 269 } 270 271 272 /***************************************************************************** 273 * Name : ParseURLIntoProtocolAndURI_W 274 * Purpose : 275 * Parameters: 276 * Variables : 277 * Result : 278 * Remark : 279 * Status : UNTESTED 280 * 281 * Author : Patrick Haller [2001-08-30] 282 *****************************************************************************/ 283 284 ODINFUNCTION2(DWORD, SHLWAPI_2, 285 LPWSTR, lpszURL, 286 LPPROTOCOLHANDLERW, lpHandler) 287 { 288 dprintf(("not yet implemented")); 289 290 // PH: do unicode conversion, call SHLWAPI_1 119 291 120 292 return 0; -
trunk/src/shlwapi/path.c
r5854 r6609 1171 1171 BOOL WINAPI PathIsURLA(LPCSTR lpstrPath) 1172 1172 { 1173 // 2001-08-30 PH 1174 // SHLWAPI/W95 Code: 1175 // 1176 // if (lpstrPath == NULL) 1177 // return FALSE; 1178 // 1179 // DWORD dwUnknown = SHREG_xxx; // 0x18 1180 // return SHLWAPI_1(lpstrPath, &dwUnknown); 1181 1182 1173 1183 LPSTR lpstrRes; 1174 1184 int iSize, i=0; -
trunk/src/shlwapi/shlwapi.def
r6608 r6609 1 ; $Id: shlwapi.def,v 1.2 5 2001-08-30 19:19:58phaller Exp $1 ; $Id: shlwapi.def,v 1.26 2001-08-30 23:37:03 phaller Exp $ 2 2 3 3 ; updated export ordinals to NT4 SP6 version of SHLWAPI.DLL … … 18 18 ; -------------------- 19 19 20 ; 2001-08-30 PH 21 ; Most of the ordinal shell functions are just dynamic mappings of 22 ; the unicode caller to the character-width of the underlying OS: 23 ; If OS == UNICODE, the call is passed through 24 ; if OS == ASCII, the parameters are mapped back and forth 25 ; So for ODIN, we're just directly linking to the unicode functions. 20 26 21 27 _SHLWAPI_1@8 @1 NONAME
Note:
See TracChangeset
for help on using the changeset viewer.