Пример #1
0
/***********************************************************************
 *           SetDeskWallPaper   (USER32.@)
 *
 * FIXME: is there a unicode version?
 */
BOOL WINAPI SetDeskWallPaper( LPCSTR filename )
{
    HBITMAP hbitmap;
    HDC hdc;
    char buffer[256];

    if (filename == (LPSTR)-1)
    {
	GetProfileStringA( "desktop", "WallPaper", "(None)", buffer, 256 );
	filename = buffer;
    }
    hdc = GetDC( 0 );
    hbitmap = DESKTOP_LoadBitmap( hdc, filename );
    ReleaseDC( 0, hdc );
    if (hbitmapWallPaper) DeleteObject( hbitmapWallPaper );
    hbitmapWallPaper = hbitmap;
    fTileWallPaper = GetProfileIntA( "desktop", "TileWallPaper", 0 );
    if (hbitmap)
    {
	BITMAP bmp;
	GetObjectA( hbitmap, sizeof(bmp), &bmp );
	bitmapSize.cx = (bmp.bmWidth != 0) ? bmp.bmWidth : 1;
	bitmapSize.cy = (bmp.bmHeight != 0) ? bmp.bmHeight : 1;
    }
    return TRUE;
}
Пример #2
0
/******************************************************************************
 *		GetDefaultPrinterA   (WINSPOOL.@)
 */
BOOL WINAPI GetDefaultPrinterA(LPSTR name, LPDWORD namesize)
{
   char *ptr;

   if (*namesize < 1)
   {
      SetLastError (ERROR_INSUFFICIENT_BUFFER);
      return FALSE;
   }

   if (!GetProfileStringA ("windows", "device", "", name, *namesize))
   {
      SetLastError (ERROR_FILE_NOT_FOUND);
      return FALSE;
   }

   if ((ptr = strchr (name, ',')) == NULL)
   {
      SetLastError (ERROR_FILE_NOT_FOUND);
      return FALSE;
   }

   *ptr = '\0';
   *namesize = strlen (name) + 1;
   return TRUE;
}
Пример #3
0
//+---------------------------------------------------------------------------
//
//  Function:   OpenDebugSinks()
//
//  Synopsis:
//
//  Arguments:
//
//  Returns:
//
//  History:    26-Jan-96   murthys   Created
//
//  Notes:
//
//----------------------------------------------------------------------------
void OpenDebugSinks()
{
        // Get LogFile name
        char tmpstr[MAX_PATH];
        DWORD cbtmpstr = sizeof(tmpstr);
        LPTSTR lptstr;

        InitializeCriticalSection(&g_LogFileCS);
        GetProfileStringA("CairOLE InfoLevels", // section
                          "LogFile",               // key
                          "",             // default value
                          tmpstr,              // return buffer
                          cbtmpstr);
        if (tmpstr[0] != '\0')
        {
#ifdef _CHICAGO_
            lptstr = tmpstr;

            WriteToLogFile(lptstr);
#else
            // convert ansi to unicode
            WCHAR wtmpstr[MAX_PATH];

            lptstr = wtmpstr;
            if (MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, tmpstr, -1, wtmpstr, MAX_PATH))
            {
                WriteToLogFile(lptstr);
            }
            else
            {
                OutputDebugStringA("OLE32: MultiByteToWideChar failed for logfile!\n");
            }
#endif
        }

        // See if Debug Screen should be turned off
        GetProfileStringA("CairOLE InfoLevels", // section
                          "DebugScreen",               // key
                          "Yes",             // default value
                          tmpstr,              // return buffer
                          cbtmpstr);
        if ((tmpstr[0] == 'n') || (tmpstr[0] == 'N'))
        {
            WriteToDebugScreen(FALSE);  // turn off output to debugger screen
        }
}
Пример #4
0
VOID
NetpGetTimeFormat(
    LPNET_TIME_FORMAT   TimeFormat
    )

/*++

Routine Description:

    This function obtains the user-specific format for the time and date
    strings (short format).  The format is returned in a structure
    pointed to by the TimeFormat parameter.

    MEMORY_USAGE   ** IMPORTANT **
    NOTE:  This function expects any NON-NULL pointers in the TimeFormat
    structure to be allocated on the heap.  It will attempt to free those
    pointers in order to update the format.  This function allocates memory
    from the heap for the various structure members that are pointers to
    strings.  It is the caller's responsiblilty to free each of these
    pointers.

Arguments:

    TimeFormat - A pointer to a structure in which the format information
        can be stored.

Return Value:


--*/
{
    CHAR        czParseString[MAX_TIME_SIZE];
    LPSTR       pTempString;
    INT         numChars;
    LPSTR       AMPMString="";
    LPSTR       ProfileLoc = "intl";
    LPSTR       emptyStr = "";

    //-----------------------------------------
    // Get the Date Format  (M/d/yy)
    //-----------------------------------------
    pTempString = czParseString;
    numChars = GetProfileStringA(
                    ProfileLoc,
                    "sShortDate",
                    emptyStr,
                    czParseString,
                    MAX_TIME_SIZE);

    if (numChars == 0) {
        //
        // No data, use the default.
        //
        pTempString = "M/d/yy";
        numChars = strlen(pTempString);
    }

    if (TimeFormat->DateFormat != NULL) {
        LocalFree(TimeFormat->DateFormat);
        TimeFormat->DateFormat = NULL;
    }

    TimeFormat->DateFormat = LocalAlloc(LMEM_ZEROINIT, numChars+sizeof(CHAR));
    if (TimeFormat->DateFormat != NULL) {
        strcpy(TimeFormat->DateFormat, pTempString);
    }

    //-----------------------------------------
    // 12 or 24 hour format?
    //-----------------------------------------
    TimeFormat->TwelveHour = TRUE;
    numChars = GetProfileStringA(
                ProfileLoc,
                "iTime",
                emptyStr,
                czParseString,
                MAX_TIME_SIZE);
    if (numChars > 0) {
        if (*czParseString == '1'){
            TimeFormat->TwelveHour = FALSE;
        }
    }

    //-----------------------------------------
    // Where put AMPM string?
    //-----------------------------------------
    TimeFormat->TimePrefix = FALSE;
    numChars = GetProfileStringA(
                ProfileLoc,
                "iTimePrefix",
                emptyStr,
                czParseString,
                MAX_TIME_SIZE);
    if (numChars > 0) {
        if (*czParseString == '1'){
            TimeFormat->TimePrefix = TRUE;
        }
    }

    //-----------------------------------------
    // Is there a Leading Zero?
    //-----------------------------------------
    TimeFormat->LeadingZero = FALSE;
    if (GetProfileIntA(ProfileLoc,"iTLZero",0) == 1) {
        TimeFormat->LeadingZero = TRUE;
    }

    //-----------------------------------------
    // Get the Time Separator character.
    //-----------------------------------------
    if (TimeFormat->TimeSeparator != NULL) {
        LocalFree(TimeFormat->TimeSeparator);
        TimeFormat->TimeSeparator == NULL;
    }
    numChars = GetProfileStringA(
                ProfileLoc,
                "sTime",
                emptyStr,
                czParseString,
                MAX_TIME_SIZE);

    if (numChars == 0) {
        //
        // No data, use the default.
        //
        pTempString = ":";
        numChars = strlen(pTempString);
    }
    else {
        pTempString = czParseString;
    }
    TimeFormat->TimeSeparator = LocalAlloc(LMEM_FIXED, numChars + sizeof(CHAR));
    if (TimeFormat->TimeSeparator != NULL) {
        strcpy(TimeFormat->TimeSeparator, pTempString);
    }
    //-------------------------------------------------
    // Get the AM string.
    //-------------------------------------------------
    pTempString = czParseString;
    numChars = GetProfileStringA(
                    ProfileLoc,
                    "s1159",
                    emptyStr,
                    czParseString,
                    MAX_TIME_SIZE);

    if (numChars == 0) {
        pTempString = emptyStr;
    }
    if (TimeFormat->AMString != NULL) {
        LocalFree(TimeFormat->AMString);
    }

    TimeFormat->AMString = LocalAlloc(LMEM_FIXED,strlen(pTempString)+sizeof(CHAR));
    if (TimeFormat->AMString != NULL) {
        strcpy(TimeFormat->AMString,pTempString);
    }

    //-------------------------------------------------
    // Get the PM string.
    //-------------------------------------------------
    pTempString = czParseString;
    numChars = GetProfileStringA(
                ProfileLoc,
                "s2359",
                emptyStr,
                czParseString,
                MAX_TIME_SIZE);

    if (numChars == 0) {
        pTempString = emptyStr;
    }
    if (TimeFormat->PMString != NULL) {
        LocalFree(TimeFormat->PMString);
    }

    TimeFormat->PMString = LocalAlloc(LMEM_FIXED,strlen(pTempString)+sizeof(WCHAR));
    if (TimeFormat->PMString != NULL) {
        strcpy(TimeFormat->PMString,pTempString);
    }

    return;
}
Пример #5
0
static void test_PrintDlgA(void)
{
    DWORD       res;
    LPPRINTDLGA pDlg;
    DEVNAMES    *pDevNames;
    LPCSTR driver;
    LPCSTR device;
    LPCSTR port;
    CHAR   buffer[MAX_PATH];
    LPSTR  ptr;


    pDlg = HeapAlloc(GetProcessHeap(), 0, (sizeof(PRINTDLGA)) * 2);
    if (!pDlg) return;


    /* will crash with unpatched wine */
    SetLastError(0xdeadbeef);
    res = PrintDlgA(NULL);
    ok( !res && (CommDlgExtendedError() == CDERR_INITIALIZATION),
        "returned %d with 0x%x and 0x%x (expected '0' and "
        "CDERR_INITIALIZATION)\n", res, GetLastError(), CommDlgExtendedError());

    ZeroMemory(pDlg, sizeof(PRINTDLGA));
    pDlg->lStructSize = sizeof(PRINTDLGA) - 1;
    SetLastError(0xdeadbeef);
    res = PrintDlgA(pDlg);
    ok( !res && (CommDlgExtendedError() == CDERR_STRUCTSIZE),
        "returned %d with 0x%x and 0x%x (expected '0' and "
        "CDERR_STRUCTSIZE)\n", res, GetLastError(), CommDlgExtendedError());

    ZeroMemory(pDlg, sizeof(PRINTDLGA));
    pDlg->lStructSize = sizeof(PRINTDLGA) + 1;
    pDlg->Flags = PD_RETURNDEFAULT;
    SetLastError(0xdeadbeef);
    res = PrintDlgA(pDlg);
    ok( !res && (CommDlgExtendedError() == CDERR_STRUCTSIZE),
        "returned %u with %u and 0x%x (expected '0' and "
        "CDERR_STRUCTSIZE)\n", res, GetLastError(), CommDlgExtendedError());


    ZeroMemory(pDlg, sizeof(PRINTDLGA));
    pDlg->lStructSize = sizeof(PRINTDLGA);
    pDlg->Flags = PD_RETURNDEFAULT;
    SetLastError(0xdeadbeef);
    res = PrintDlgA(pDlg);
    ok( res || (CommDlgExtendedError() == PDERR_NODEFAULTPRN),
        "returned %d with 0x%x and 0x%x (expected '!= 0' or '0' and "
        "PDERR_NODEFAULTPRN)\n", res, GetLastError(), CommDlgExtendedError());

    if (!res && (CommDlgExtendedError() == PDERR_NODEFAULTPRN)) {
        skip("No printer configured.\n");
        HeapFree(GetProcessHeap(), 0, pDlg);
        return;
    }

    ok(pDlg->hDevNames != NULL, "(expected '!= NULL')\n");
    pDevNames = GlobalLock(pDlg->hDevNames);
    ok(pDevNames != NULL, "(expected '!= NULL')\n");

    if (pDevNames) {
        ok(pDevNames->wDriverOffset, "(expected '!= 0' for wDriverOffset)\n");
        ok(pDevNames->wDeviceOffset, "(expected '!= 0' for wDeviceOffset)\n");
        ok(pDevNames->wOutputOffset, "(expected '!= 0' for wOutputOffset)\n");
        ok(pDevNames->wDefault == DN_DEFAULTPRN, "got 0x%x (expected DN_DEFAULTPRN)\n", pDevNames->wDefault);

        driver = (LPCSTR)pDevNames + pDevNames->wDriverOffset;
        device = (LPCSTR)pDevNames + pDevNames->wDeviceOffset;
        port = (LPCSTR)pDevNames + pDevNames->wOutputOffset;
        trace("driver '%s' device '%s' port '%s'\n", driver, device, port);

        /* The Driver Entry does not include a Path */
        ptr = strrchr(driver, '\\');
        todo_wine {
        ok( ptr == NULL, "got %p for '%s' (expected NULL for a simple name)\n", ptr, driver);
        }

        /* The Driver Entry does not have an extension (fixed to ".drv") */
        ptr = strrchr(driver, '.');
        todo_wine {
        ok( ptr == NULL, "got %p for '%s' (expected NULL for no extension)\n", ptr, driver);
        }


        buffer[0] = '\0';
        SetLastError(0xdeadbeef);
        res = GetProfileStringA(PrinterPortsA, device, emptyA, buffer, sizeof(buffer));
        ptr = strchr(buffer, ',');
        ok( (res > 1) && (ptr != NULL),
            "got %u with %u and %p for '%s' (expected '>1' and '!= NULL')\n",
            res, GetLastError(), ptr, buffer);

        if (ptr) ptr[0] = '\0';
        todo_wine {
        ok( lstrcmpiA(driver, buffer) == 0,
            "got driver '%s' (expected '%s')\n", driver, buffer);
        }

    }

    GlobalUnlock(pDlg->hDevNames);

    GlobalFree(pDlg->hDevMode);
    GlobalFree(pDlg->hDevNames);
    HeapFree(GetProcessHeap(), 0, pDlg);

}
Пример #6
0
static void test_PrintDlgA(void)
{
    DWORD res, n_copies = 0;
    LPPRINTDLGA pDlg;
    DEVNAMES    *pDevNames;
    LPCSTR driver;
    LPCSTR device;
    LPCSTR port;
    CHAR   buffer[MAX_PATH];
    LPSTR  ptr;
    DEVMODEA *dm;

    pDlg = HeapAlloc(GetProcessHeap(), 0, (sizeof(PRINTDLGA)) * 2);
    if (!pDlg) return;


    /* will crash with unpatched wine */
    SetLastError(0xdeadbeef);
    res = PrintDlgA(NULL);
    ok( !res && (CommDlgExtendedError() == CDERR_INITIALIZATION),
        "returned %d with 0x%x and 0x%x (expected '0' and "
        "CDERR_INITIALIZATION)\n", res, GetLastError(), CommDlgExtendedError());

    ZeroMemory(pDlg, sizeof(PRINTDLGA));
    pDlg->lStructSize = sizeof(PRINTDLGA) - 1;
    SetLastError(0xdeadbeef);
    res = PrintDlgA(pDlg);
    ok( !res && (CommDlgExtendedError() == CDERR_STRUCTSIZE),
        "returned %d with 0x%x and 0x%x (expected '0' and "
        "CDERR_STRUCTSIZE)\n", res, GetLastError(), CommDlgExtendedError());

    ZeroMemory(pDlg, sizeof(PRINTDLGA));
    pDlg->lStructSize = sizeof(PRINTDLGA) + 1;
    pDlg->Flags = PD_RETURNDEFAULT;
    SetLastError(0xdeadbeef);
    res = PrintDlgA(pDlg);
    ok( !res && (CommDlgExtendedError() == CDERR_STRUCTSIZE),
        "returned %u with %u and 0x%x (expected '0' and "
        "CDERR_STRUCTSIZE)\n", res, GetLastError(), CommDlgExtendedError());


    ZeroMemory(pDlg, sizeof(PRINTDLGA));
    pDlg->lStructSize = sizeof(PRINTDLGA);
    pDlg->Flags = PD_RETURNDEFAULT;
    SetLastError(0xdeadbeef);
    res = PrintDlgA(pDlg);
    ok( res || (CommDlgExtendedError() == PDERR_NODEFAULTPRN),
        "returned %d with 0x%x and 0x%x (expected '!= 0' or '0' and "
        "PDERR_NODEFAULTPRN)\n", res, GetLastError(), CommDlgExtendedError());

    if (!res && (CommDlgExtendedError() == PDERR_NODEFAULTPRN)) {
        skip("No printer configured.\n");
        HeapFree(GetProcessHeap(), 0, pDlg);
        return;
    }

    ok(pDlg->hDevNames != NULL, "(expected '!= NULL')\n");
    pDevNames = GlobalLock(pDlg->hDevNames);
    ok(pDevNames != NULL, "(expected '!= NULL')\n");

    if (pDevNames) {
        ok(pDevNames->wDriverOffset, "(expected '!= 0' for wDriverOffset)\n");
        ok(pDevNames->wDeviceOffset, "(expected '!= 0' for wDeviceOffset)\n");
        ok(pDevNames->wOutputOffset, "(expected '!= 0' for wOutputOffset)\n");
        ok(pDevNames->wDefault == DN_DEFAULTPRN, "got 0x%x (expected DN_DEFAULTPRN)\n", pDevNames->wDefault);

        driver = (LPCSTR)pDevNames + pDevNames->wDriverOffset;
        device = (LPCSTR)pDevNames + pDevNames->wDeviceOffset;
        port = (LPCSTR)pDevNames + pDevNames->wOutputOffset;
        trace("driver '%s' device '%s' port '%s'\n", driver, device, port);

        /* The Driver Entry does not include a Path */
        ptr = strrchr(driver, '\\');
        ok( ptr == NULL, "got %p for '%s' (expected NULL for a simple name)\n", ptr, driver);

        /* The Driver Entry does not have an extension (fixed to ".drv") */
        ptr = strrchr(driver, '.');
        todo_wine {
        ok( ptr == NULL, "got %p for '%s' (expected NULL for no extension)\n", ptr, driver);
        }


        buffer[0] = '\0';
        SetLastError(0xdeadbeef);
        res = GetProfileStringA(PrinterPortsA, device, emptyA, buffer, sizeof(buffer));
        ptr = strchr(buffer, ',');
        ok( (res > 1) && (ptr != NULL),
            "got %u with %u and %p for '%s' (expected '>1' and '!= NULL')\n",
            res, GetLastError(), ptr, buffer);

        if (ptr) ptr[0] = '\0';
        ok( lstrcmpiA(driver, buffer) == 0,
            "got driver '%s' (expected '%s')\n", driver, buffer);

        n_copies = DeviceCapabilitiesA(device, port, DC_COPIES, NULL, NULL);
        ok(n_copies > 0, "DeviceCapabilities(DC_COPIES) failed\n");
    }

    GlobalUnlock(pDlg->hDevNames);
    GlobalFree(pDlg->hDevMode);
    GlobalFree(pDlg->hDevNames);

    /* if device doesn't support printing of multiple copies then
     * an attempt to set number of copies > 1 in print dialog would
     * cause the PrintDlg under Windows display the MessageBox and
     * the test will hang waiting for user response.
     */
    if (n_copies > 1)
    {
        ZeroMemory(pDlg, sizeof(*pDlg));
        pDlg->lStructSize = sizeof(*pDlg);
        pDlg->Flags = PD_ENABLEPRINTHOOK;
        pDlg->lpfnPrintHook = print_hook_proc;
        res = PrintDlgA(pDlg);
        ok(res, "PrintDlg error %#x\n", CommDlgExtendedError());
        /* Version of Microsoft XPS Document Writer driver shipped before Win7
         * reports that it can print multiple copies, but returns 1.
         */
        ok(pDlg->nCopies == 123 || broken(pDlg->nCopies == 1), "expected nCopies 123, got %d\n", pDlg->nCopies);
        ok(pDlg->hDevMode != 0, "hDevMode should not be 0\n");
        dm = GlobalLock(pDlg->hDevMode);
        /* some broken drivers use always PD_USEDEVMODECOPIES */
        ok((S1(U1(*dm)).dmCopies == 1) || broken(S1(U1(*dm)).dmCopies == 123),
            "expected dm->dmCopies 1, got %d\n", S1(U1(*dm)).dmCopies);
        GlobalUnlock(pDlg->hDevMode);
        GlobalFree(pDlg->hDevMode);
        GlobalFree(pDlg->hDevNames);

        ZeroMemory(pDlg, sizeof(*pDlg));
        pDlg->lStructSize = sizeof(*pDlg);
        pDlg->Flags = PD_ENABLEPRINTHOOK | PD_USEDEVMODECOPIES;
        pDlg->lpfnPrintHook = print_hook_proc;
        res = PrintDlgA(pDlg);
        ok(res, "PrintDlg error %#x\n", CommDlgExtendedError());
        ok(pDlg->nCopies == 1, "expected nCopies 1, got %d\n", pDlg->nCopies);
        ok(pDlg->hDevMode != 0, "hDevMode should not be 0\n");
        dm = GlobalLock(pDlg->hDevMode);
        ok(S1(U1(*dm)).dmCopies == 123, "expected dm->dmCopies 123, got %d\n", S1(U1(*dm)).dmCopies);
        GlobalUnlock(pDlg->hDevMode);
        GlobalFree(pDlg->hDevMode);
        GlobalFree(pDlg->hDevNames);
    }

    HeapFree(GetProcessHeap(), 0, pDlg);
}
Пример #7
0
BOOL _ProcessAttach(HINSTANCE hDll)     // 32-bit
{
    BOOL fSuccess = TRUE;

    // _asm int 3;

    g_hinst = hDll;
    g_hProcessHeap = GetProcessHeap();

#ifdef WINNT
    //
    // NT has no shared critical sections
    //
    InitializeCriticalSection(&g_csShell);
    InitializeCriticalSection(&g_csPrinters);
#else
    //
    // This must be called for each attaching process otherwise
    // when the first process terminates the cs will be reclaimed.
    //
    ReinitializeCriticalSection(&g_csPrinters);
    ReinitializeCriticalSection(&g_csShell);
#endif

    //
    // Open the useful registry keys
    //
    RegOpenKey(HKEY_CLASSES_ROOT, c_szCLSID, &g_hkcrCLSID);
    RegCreateKey(HKEY_CURRENT_USER, c_szRegExplorer, &g_hkcuExplorer);
    RegCreateKey(HKEY_LOCAL_MACHINE, c_szRegExplorer, &g_hklmExplorer);

#ifdef WINNT
    if (0 != SHRestricted(REST_ENFORCESHELLEXTSECURITY))
        RegOpenKey(HKEY_LOCAL_MACHINE, c_szApproved, &g_hklmApprovedExt);


    // Fetch the alternate color (for compression) if supplied.

    {
        DWORD cbData = sizeof(COLORREF);
        DWORD dwType;
        RegQueryValueEx(g_hkcuExplorer, c_szAltColor, NULL, &dwType, (LPBYTE)&g_crAltColor, &cbData);
    }
#endif

    ENTERCRITICAL;
    if (g_cProcesses == 0) {
        fSuccess = _Initialize_SharedData();
    }
    g_cProcesses++;
    LEAVECRITICAL;

    DebugMsg(DM_TRACE, TEXT("shell32: ProcessAttach: %s %d (%x)"), GetCurrentApp(), g_cProcesses, hDll);

#ifdef DEBUG
#define DEREFMACRO(x) x
#define ValidateORD(_name) Assert( _name == (LPVOID)GetProcAddress(hDll, (LPSTR)MAKEINTRESOURCE(DEREFMACRO(_name##ORD))) )
    if (g_cProcesses==1)        // no need to be in critical section (just debug)
    {
        ValidateORD(SHValidateUNC);
        ValidateORD(SHChangeNotifyRegister);
        ValidateORD(SHChangeNotifyDeregister);
        ValidateORD(OleStrToStrN);
        ValidateORD(SHCloneSpecialIDList);
        Assert(DllGetClassObject==(LPVOID)GetProcAddress(hDll,(LPSTR)MAKEINTRESOURCE(SHDllGetClassObjectORD)));
        ValidateORD(SHLogILFromFSIL);
        ValidateORD(SHMapPIDLToSystemImageListIndex);
        ValidateORD(SHShellFolderView_Message);
        ValidateORD(Shell_GetImageLists);
        ValidateORD(SHGetSpecialFolderPath);
        ValidateORD(StrToOleStrN);

        ValidateORD(ILClone);
        ValidateORD(ILCloneFirst);
        ValidateORD(ILCombine);
        ValidateORD(ILCreateFromPath);
        ValidateORD(ILFindChild);
        ValidateORD(ILFree);
        ValidateORD(ILGetNext);
        ValidateORD(ILGetSize);
        ValidateORD(ILIsEqual);
        ValidateORD(ILRemoveLastID);
        ValidateORD(PathAddBackslash);
        ValidateORD(PathCombine);
        ValidateORD(PathIsExe);
        ValidateORD(PathMatchSpec);
        ValidateORD(SHGetSetSettings);
        ValidateORD(SHILCreateFromPath);
        ValidateORD(SHFree);

        ValidateORD(SHAddFromPropSheetExtArray);
        ValidateORD(SHCreatePropSheetExtArray);
        ValidateORD(SHDestroyPropSheetExtArray);
        ValidateORD(SHReplaceFromPropSheetExtArray);
        ValidateORD(SHCreateDefClassObject);
        ValidateORD(SHGetNetResource);
    }

#ifdef WINNT
    /*
     * read wDebugMask entry from win.ini for SHELL32.DLL.
     * The default is 0x000E, which includes DM_WARNING, DM_ERROR,
     * and DM_ASSERT.  The default has DM_TRACE and DM_ALLOC turned
     * off.
     */
    {
        CHAR szDebugMask[ 80 ];

        if (GetProfileStringA( "Shell32", "DebugMask", "0x000E",
                               szDebugMask, ARRAYSIZE(szDebugMask)) > 0 )
        {
            sscanf( szDebugMask, "%i", &wDebugMask );
        }

    }
#endif // WINNT
#endif

    //
    // All the per-instance initialization code should come here.
    //

    //
    // This block must be placed at the end of this function.
    //
#ifdef DEBUG
    {
        extern LPMALLOC g_pmemTask;
        if (g_pmemTask)
        {
            MessageBeep(0);
            DebugMsg(DM_ERROR, TEXT("sh TR - Somebody called SHAlloc in LibMain!"));
            Assert(0);
        }
    }
#endif

    return fSuccess;
}