Changeset 1551 for trunk/src


Ignore:
Timestamp:
Nov 2, 1999, 8:17:16 PM (26 years ago)
Author:
phaller
Message:

Add: update to wine/shell32 1999/11/02 #2

Location:
trunk/src/shell32
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/shell32/makefile

    r1547 r1551  
    1 # $Id: makefile,v 1.16 1999-11-02 19:08:17 sandervl Exp $
     1# $Id: makefile,v 1.17 1999-11-02 19:17:15 phaller Exp $
    22
    33#
     
    3232        shellord.obj shellpath.obj shv_bg_cmenu.obj \
    3333        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
    3535
    3636all: $(TARGET).dll $(TARGET).lib
     
    5454        $(IMPDEF) $** $@
    5555
    56 resource.asm: shres.rc 
     56resource.asm: shres.rc
    5757    $(RC) $(RCFLAGS) -o resource.asm shres.rc
    5858
     
    8686she.obj:          she.cpp
    8787sh.obj:           sh.cpp
     88shpolicy.obj:     shpolicy.cpp shpolicy.h
    8889
    8990clean:
  • trunk/src/shell32/shellord.cpp

    r1215 r1551  
    1 /* $Id: shellord.cpp,v 1.2 1999-10-09 11:17:05 sandervl Exp $ */
     1/* $Id: shellord.cpp,v 1.3 1999-11-02 19:17:15 phaller Exp $ */
    22/*
    33 * The parameters of many functions changes between different OS versions
     
    2424#include "shell32_main.h"
    2525#include "wine/undocshell.h"
     26#include "shpolicy.h"
    2627
    2728#include <heapstring.h>
     
    341342 *
    342343 * 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.
    364346 *
    365347 * NOTES
    366348 *     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
    367354 */
    368355DWORD WINAPI SHRestricted (DWORD pol) {
     356        char regstr[256];
    369357        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);
    373378                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
    375400        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
     431BOOL 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;
    377457}
    378458
     
    805885          return E_FAIL;
    806886
    807         SHELL32_IExplorerInterface->lpvtbl->fnAddRef(SHELL32_IExplorerInterface);
     887        IUnknown_AddRef(SHELL32_IExplorerInterface);
    808888        return NOERROR;
    809889}
     
    864944        return RegOpenKeyW( hkey, lpszSubKey, retkey );
    865945}
    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 
    877946/*************************************************************************
    878947 * SHRegQueryValueExA                           [SHELL32.509]
     
    11751244}
    11761245/*************************************************************************
     1246 * StrRChrA                                     [SHELL32.346]
     1247 *
     1248 */
     1249LPSTR 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/*************************************************************************
    11771268 * StrRChrW                                     [SHELL32.320]
    11781269 *
     
    13461437}
    13471438
     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
     1447BOOL 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
     1464BOOL 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 sandervl Exp $ */
     1/* $Id: unknown.cpp,v 1.8 1999-11-02 19:17:16 phaller Exp $ */
    22
    33/*
     
    272272}
    273273
     274
     275/*************************************************************************
     276 * SHRegQueryValueA                             [NT4.0:SHELL32.?]
     277 *
     278 */
     279ODINFUNCTION4(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.