- Timestamp:
- Nov 2, 1999, 8:17:16 PM (26 years ago)
- Location:
- trunk/src/shell32
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shell32/makefile
r1547 r1551 1 # $Id: makefile,v 1.1 6 1999-11-02 19:08:17 sandervlExp $1 # $Id: makefile,v 1.17 1999-11-02 19:17:15 phaller Exp $ 2 2 3 3 # … … 32 32 shellord.obj shellpath.obj shv_bg_cmenu.obj \ 33 33 shlfolder.obj shlview.obj shell.obj unknown.obj misc.obj \ 34 she.obj sh.obj resource.obj 34 she.obj sh.obj resource.obj shpolicy.obj 35 35 36 36 all: $(TARGET).dll $(TARGET).lib … … 54 54 $(IMPDEF) $** $@ 55 55 56 resource.asm: shres.rc 56 resource.asm: shres.rc 57 57 $(RC) $(RCFLAGS) -o resource.asm shres.rc 58 58 … … 86 86 she.obj: she.cpp 87 87 sh.obj: sh.cpp 88 shpolicy.obj: shpolicy.cpp shpolicy.h 88 89 89 90 clean: -
trunk/src/shell32/shellord.cpp
r1215 r1551 1 /* $Id: shellord.cpp,v 1. 2 1999-10-09 11:17:05 sandervlExp $ */1 /* $Id: shellord.cpp,v 1.3 1999-11-02 19:17:15 phaller Exp $ */ 2 2 /* 3 3 * The parameters of many functions changes between different OS versions … … 24 24 #include "shell32_main.h" 25 25 #include "wine/undocshell.h" 26 #include "shpolicy.h" 26 27 27 28 #include <heapstring.h> … … 341 342 * 342 343 * walks through policy table, queries <app> key, <type> value, returns 343 * queried (DWORD) value. 344 * {0x00001,Explorer,NoRun} 345 * {0x00002,Explorer,NoClose} 346 * {0x00004,Explorer,NoSaveSettings} 347 * {0x00008,Explorer,NoFileMenu} 348 * {0x00010,Explorer,NoSetFolders} 349 * {0x00020,Explorer,NoSetTaskbar} 350 * {0x00040,Explorer,NoDesktop} 351 * {0x00080,Explorer,NoFind} 352 * {0x00100,Explorer,NoDrives} 353 * {0x00200,Explorer,NoDriveAutoRun} 354 * {0x00400,Explorer,NoDriveTypeAutoRun} 355 * {0x00800,Explorer,NoNetHood} 356 * {0x01000,Explorer,NoStartBanner} 357 * {0x02000,Explorer,RestrictRun} 358 * {0x04000,Explorer,NoPrinterTabs} 359 * {0x08000,Explorer,NoDeletePrinter} 360 * {0x10000,Explorer,NoAddPrinter} 361 * {0x20000,Explorer,NoStartMenuSubFolders} 362 * {0x40000,Explorer,MyDocsOnNet} 363 * {0x80000,WinOldApp,NoRealMode} 344 * queried (DWORD) value, and caches it between called to SHInitRestricted 345 * to prevent unnecessary registry access. 364 346 * 365 347 * NOTES 366 348 * exported by ordinal 349 * 350 * REFERENCES: 351 * MS System Policy Editor 352 * 98Lite 2.0 (which uses many of these policy keys) http://www.98lite.net/ 353 * "The Windows 95 Registry", by John Woram, 1996 MIS: Press 367 354 */ 368 355 DWORD WINAPI SHRestricted (DWORD pol) { 356 char regstr[256]; 369 357 HKEY xhkey; 370 371 FIXME("(%08lx):stub.\n",pol); 372 if (RegOpenKeyA(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies",&xhkey)) 358 DWORD retval, polidx, i, datsize = 4; 359 360 TRACE("(%08lx)\n",pol); 361 362 polidx = -1; 363 364 /* scan to see if we know this policy ID */ 365 for (i = 0; i < SHELL_MAX_POLICIES; i++) 366 { 367 if (pol == sh32_policy_table[i].polflags) 368 { 369 polidx = i; 370 break; 371 } 372 } 373 374 if (polidx == -1) 375 { 376 /* we don't know this policy, return 0 */ 377 TRACE("unknown policy: (%08lx)\n", pol); 373 378 return 0; 374 /* FIXME: do nothing for now, just return 0 (== "allowed") */ 379 } 380 381 /* we have a known policy */ 382 lstrcpyA(regstr, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\"); 383 lstrcatA(regstr, sh32_policy_table[polidx].appstr); 384 385 /* first check if this policy has been cached, return it if so */ 386 if (sh32_policy_table[polidx].cache != SHELL_NO_POLICY) 387 { 388 return sh32_policy_table[polidx].cache; 389 } 390 391 /* return 0 and don't set the cache if any registry errors occur */ 392 retval = 0; 393 if (RegOpenKeyA(HKEY_CURRENT_USER, regstr, &xhkey) == ERROR_SUCCESS) 394 { 395 if (RegQueryValueExA(xhkey, sh32_policy_table[polidx].keystr, NULL, NULL, (LPBYTE)&retval, &datsize) == ERROR_SUCCESS) 396 { 397 sh32_policy_table[polidx].cache = retval; 398 } 399 375 400 RegCloseKey(xhkey); 376 return 0; 401 } 402 403 return retval; 404 } 405 406 /************************************************************************* 407 * SHInitRestricted [SHELL32.244] 408 * 409 * Win98+ by-ordinal only routine called by Explorer and MSIE 4 and 5. 410 * Inits the policy cache used by SHRestricted to avoid excess 411 * registry access. 412 * 413 * INPUTS 414 * Two inputs: one is a string or NULL. If non-NULL the pointer 415 * should point to a string containing the following exact text: 416 * "Software\Microsoft\Windows\CurrentVersion\Policies". 417 * The other input is unused. 418 * 419 * NOTES 420 * If the input is non-NULL and does not point to a string containing 421 * that exact text the routine will do nothing. 422 * 423 * If the text does match or the pointer is NULL, then the routine 424 * will init SHRestricted()'s policy cache to all 0xffffffff and 425 * returns 0xffffffff as well. 426 * 427 * I haven't yet run into anything calling this with inputs other than 428 * (NULL, NULL), so I may have the inputs reversed. 429 */ 430 431 BOOL WINAPI SHInitRestricted(LPSTR inpRegKey, LPSTR parm2) 432 { 433 int i; 434 435 dprintf(("SHELL32:SHELLORD:SHInitRestricted(%p, %p)\n", inpRegKey, parm2)); 436 437 /* first check - if input is non-NULL and points to the secret 438 key string, then pass. Otherwise return 0. 439 */ 440 441 if (inpRegKey != (LPSTR)NULL) 442 { 443 if (lstrcmpiA(inpRegKey, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies")) 444 { 445 /* doesn't match, fail */ 446 return 0; 447 } 448 } 449 450 /* check passed, init all policy cache entries with SHELL_NO_POLICY */ 451 for (i = 0; i < SHELL_MAX_POLICIES; i++) 452 { 453 sh32_policy_table[i].cache = SHELL_NO_POLICY; 454 } 455 456 return SHELL_NO_POLICY; 377 457 } 378 458 … … 805 885 return E_FAIL; 806 886 807 SHELL32_IExplorerInterface->lpvtbl->fnAddRef(SHELL32_IExplorerInterface);887 IUnknown_AddRef(SHELL32_IExplorerInterface); 808 888 return NOERROR; 809 889 } … … 864 944 return RegOpenKeyW( hkey, lpszSubKey, retkey ); 865 945 } 866 /*************************************************************************867 * SHRegQueryValueA [NT4.0:SHELL32.?]868 *869 */870 HRESULT WINAPI SHRegQueryValueA (HKEY hkey, LPSTR lpszSubKey,871 LPSTR lpszData, LPDWORD lpcbData )872 { WARN("0x%04x %s %p %p semi-stub\n",873 hkey, lpszSubKey, lpszData, lpcbData);874 return RegQueryValueA( hkey, lpszSubKey, lpszData, (LPLONG)lpcbData );875 }876 877 946 /************************************************************************* 878 947 * SHRegQueryValueExA [SHELL32.509] … … 1175 1244 } 1176 1245 /************************************************************************* 1246 * StrRChrA [SHELL32.346] 1247 * 1248 */ 1249 LPSTR WINAPI StrRChrA(LPCSTR lpStart, LPCSTR lpEnd, DWORD wMatch) 1250 { 1251 if (!lpStart) 1252 return NULL; 1253 1254 /* if the end not given, search*/ 1255 if (!lpEnd) 1256 { lpEnd=lpStart; 1257 while (*lpEnd) 1258 lpEnd++; 1259 } 1260 1261 for (--lpEnd;lpStart <= lpEnd; lpEnd--) 1262 if (*lpEnd==(char)wMatch) 1263 return (LPSTR)lpEnd; 1264 1265 return NULL; 1266 } 1267 /************************************************************************* 1177 1268 * StrRChrW [SHELL32.320] 1178 1269 * … … 1346 1437 } 1347 1438 1439 /************************************************************************* 1440 * shell32_243 [SHELL32.243] 1441 * 1442 * Win98+ by-ordinal routine. In Win98 this routine returns zero and 1443 * does nothing else. Possibly this does something in NT or SHELL32 5.0? 1444 * 1445 */ 1446 1447 BOOL WINAPI shell32_243(DWORD a, DWORD b) 1448 { 1449 return FALSE; 1450 } 1451 1452 /************************************************************************ 1453 * Win32DeleteFile [SHELL32.164] 1454 * 1455 * Deletes a file. Also triggers a change notify if one exists, but 1456 * that mechanism doesn't yet exist in Wine's SHELL32. 1457 * 1458 * FIXME: 1459 * Verified on Win98 / IE 5 (SHELL32 4.72, March 1999 build) to be 1460 * ANSI. Is this Unicode on NT? 1461 * 1462 */ 1463 1464 BOOL WINAPI Win32DeleteFile(LPSTR fName) 1465 { 1466 dprintf(("SHELL32:SHELLORD:Win32DeleteFile %p(%s): partial stub\n", fName, fName)); 1467 1468 DeleteFileA(fName); 1469 1470 return TRUE; 1471 } -
trunk/src/shell32/unknown.cpp
r1214 r1551 1 /* $Id: unknown.cpp,v 1. 7 1999-10-09 11:13:25 sandervlExp $ */1 /* $Id: unknown.cpp,v 1.8 1999-11-02 19:17:16 phaller Exp $ */ 2 2 3 3 /* … … 272 272 } 273 273 274 275 /************************************************************************* 276 * SHRegQueryValueA [NT4.0:SHELL32.?] 277 * 278 */ 279 ODINFUNCTION4(HRESULT,SHRegQueryValueA,HKEY, hkey, 280 LPSTR, lpszSubKey, 281 LPSTR, lpszData, 282 LPDWORD,lpcbData ) 283 { dprintf(("SHELL32:UNKNOWN:SHRegQueryValueA(0x%04x %s %p %p semi-stub\n", 284 hkey, lpszSubKey, lpszData, lpcbData)); 285 return RegQueryValueA( hkey, lpszSubKey, lpszData, (LPLONG)lpcbData ); 286 }
Note:
See TracChangeset
for help on using the changeset viewer.