Ignore:
Timestamp:
Sep 26, 2012, 12:55:40 AM (13 years ago)
Author:
dmik
Message:

odininst: Register DLLs that require registration.

Do what regsvr32 does on a real Win32 machine. Necessary for
some DLLs (e.g. RSAENH.DLL that must add some Registry entries
for proper operation).

This fixes playback of some Flash content for Flash versions starting
from 10.1.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/install/odininst.cpp

    r21916 r22023  
    5555BOOL InitSystemAndRegistry();
    5656void SetupTimeZoneInfo();
     57void RegisterDLLs();
    5758
    5859//******************************************************************************
     
    8687
    8788  SetupTimeZoneInfo();
     89
     90  RegisterDLLs();
     91
    8892  return 0;
    8993}
     
    10921096//******************************************************************************
    10931097//******************************************************************************
    1094 
     1098void RegisterDLLs()
     1099{
     1100    // Register a number of DLLs that perform necessary initialization in
     1101    // DLLRegisterServer(). On a real machine this is done by regsvr32.exe
     1102    // during installation. Since we don't have regsvr32.exe, we will call
     1103    // this entry point manually from here.
     1104
     1105    char buf[sizeof(DIR_System)+260];
     1106
     1107    const char *DLLs[] = { "RSAENH.DLL" };
     1108
     1109    for (int i = 0; i < sizeof(DLLs)/sizeof(DLLs[0]); i++)
     1110    {
     1111        sprintf(buf, "%s\\%s", DIR_System, DLLs[i]);
     1112
     1113        dprintf(("RegisterDLLs: Registering %s", buf));
     1114
     1115        HMODULE hmod = LoadLibrary(buf);
     1116        if (!hmod)
     1117        {
     1118            dprintf(("RegisterDLLs: Unable to load DLL %s (error %d)",
     1119                     buf, GetLastError()));
     1120            continue;
     1121        }
     1122
     1123        typedef HRESULT WINAPI fnDllRegisterServer();
     1124
     1125        fnDllRegisterServer *proc = (fnDllRegisterServer *)
     1126            GetProcAddress(hmod, "DllRegisterServer");
     1127        if (!proc)
     1128        {
     1129            dprintf(("RegisterDLLs: Unable to find DllRegisterServer "
     1130                     "in %s (error %d)", buf, GetLastError()));
     1131        }
     1132        else
     1133        {
     1134            HRESULT hrc = proc();
     1135            if (hrc)
     1136                dprintf(("RegisterDLLs: Calling DllRegisterServer "
     1137                         "in %s returned error %x", buf, hrc));
     1138        }
     1139
     1140        FreeLibrary(hmod);
     1141    }
     1142
     1143
     1144        ProcessEmbeddedFile(TimeZones, TRUE);
     1145}
     1146//******************************************************************************
     1147//******************************************************************************
     1148
Note: See TracChangeset for help on using the changeset viewer.