Search code examples
c#iisiis-632bit-64bit

IIS 6.0 64-bit: SysInterals Proc Explorer showing 32-bit DLLs loaded?


Trying to pin down an issue that is most likely due to our web application trying to load a 32-bit version of OracleAccess.dll when IIS is running as 64-bit (it looks like both 32-bit and 64-bit versions of the Oracle drivers may be installed side-by-side).

I have two sites on the server, one for production, and one for test. The production one has code that was deployed by an employee who is no longer with us. That site works. The other site we've just deployed; it was compiled for Any CPU, and we get errors loading the Oracle drivers.

If I view the IIS worker process for the production site in SysInternal's process explorer, highlight the IIS worker process, and view the loaded DLLs in the lower pane view, I see some strange data.

Info for the worker process:

Process   Version        User Name                     PID   Image Type
w3wp.exe  6.0.3790.3959  NT AUTHORITY\NETWORK SERVICE  3320  64-bit 

But in the list of DLLs that are loaded, some are listed as 64-bit images, and some are listed as 32-bit? It's not possible (AFAIK) to load 32-bit DLLs into a 64-bit process space, so maybe I'm not understanding the report I'm seeing.

Subset of the DLL Handle info:

Name                Image Type   Description                          Company Name            Version         
aspnet_filter.dll   64-bit       Microsoft ASP.NET ISAPI Filter DLL   Microsoft Corporation   4.0.30319.1     
admwprox.dll        64-bit       IIS Admin Com API Proxy dll          Microsoft Corporation   6.0.3790.3959
adsldp.dll          64-bit       ADs LDAP Provider DLL                Microsoft Corporation   5.2.3790.3959
adsldpc.dll         64-bit       ADs LDAP Provider C DLL              Microsoft Corporation   5.2.3790.3959
advapi32.dll        64-bit       Advanced Windows 32 Base API         Microsoft Corporation   5.2.3790.4555
aspnet_filter.dll   64-bit       Microsoft ASP.NET ISAPI Filter DLL   Microsoft Corporation   4.0.30319.1
aspnet_isapi.dll    64-bit       Microsoft ASP.NET ISAPI Shim DLL     Microsoft Corporation   2.0.50727.3053
comctl32.dll        64-bit       Common Controls Library              Microsoft Corporation   5.82.3790.4770
comctl32.dll        64-bit       User Experience Controls Library     Microsoft Corporation   6.0.3790.4770
comres.dll          64-bit       COM+ Resources                       Microsoft Corporation   2001.12.4720.3959

    (Next few are our DLLs)

CSA.Database.DLL             32-bit       CSA.Database                         TE                      1.7.8221.0
CSA.Database.DLL             32-bit       CSA.Database                         TE                      1.7.8221.0
CSA.Loggers.DLL              32-bit       CSA.Loggers                          TE                      1.7.8221.0
CSA.Loggers.DLL              32-bit       CSA.Loggers                          TE                      1.7.8221.0
CSA.Network.DLL              32-bit       CSA.Network                          TE                      1.7.8221.0
CSA.Network.DLL              32-bit       CSA.Network                          TE                      1.7.8221.0
Enterprise.Data.DLL          32-bit       Enterprise.Data                      TE                      2.35.3.0
Enterprise.Data.DLL          32-bit       Enterprise.Data                      TE                      2.35.3.0
Enterprise.Diagnostics.DLL   32-bit       Enterprise.Diagnostics          TE                      2.35.3.0
Enterprise.Diagnostics.DLL   32-bit       Enterprise.Diagnostics          TE                      2.35.3.0

    (More Microsoft DLLs... some 32-bit, some 64-bit??)

FederatedLibrary.DLL   32-bit   FederatedLibrary   Microsoft   1.0.0.0
FederatedLibrary.DLL   32-bit   FederatedLibrary   Microsoft   1.0.0.0
gdi32.dll              64-bit   GDI Client DLL     Microsoft Corporation   5.2.3790.4396
gzip.dll               64-bit   GZIP Compressn DLL Microsoft Corporation   6.0.3790.1830

Microsoft.Practices.EnterpriseLibrary.Common.DLL   32-bit   Enterprise Library Shared Library   Microsoft Corporation   4.1.0.0
Microsoft.Practices.EnterpriseLibrary.Common.DLL   32-bit   Enterprise Library Shared Library   Microsoft Corporation   4.1.0.0
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.DLL   32-bit   Enterprise Library Exception Handling Application Block   Microsoft Corporation   4.1.0.0
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.DLL   32-bit   Enterprise Library Exception Handling Application Block   Microsoft Corporation   4.1.0.0
Microsoft.Practices.EnterpriseLibrary.Logging.DLL  32-bit   Enterprise Library Logging Application Block   Microsoft Corporation   4.1.0.0
Microsoft.Practices.EnterpriseLibrary.Logging.DLL  32-bit   Enterprise Library Logging Application Block   Microsoft Corporation   4.1.0.0

    (And finally, the Oracle drivers that seem to be causing issue... 64-bit)

oracle.dataaccess.dll   64-bit   Oracle.DataAccess.dll   Oracle Corporation   2.112.1.0
oracle.dataaccess.dll   64-bit   Oracle.DataAccess.dll   Oracle Corporation   2.112.1.0

I've used corflags to see if the working, production DLLs were compiled explicitly for 32-bit... If I understand the output, they're not.

C:\SingleSignOn\bin>corflags CSA.Network.dll
Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  4.0.30319.1
Copyright (c) Microsoft Corporation.  All rights reserved.

Version   : v2.0.50727
CLR Header: 2.5
PE        : PE32
CorFlags  : 1
ILONLY    : 1
32BIT     : 0
Signed    : 0


The first step in understanding why our newly-compiled deployment doesn't work is to understand why the current one does. Can anyone explain to me what I'm seeing?

What I need to know:

  1. Is IIS running as a 64-bit process, and will it load Any CPU DLLs as 64-bit?
  2. If yes, why are those DLLs listed by Process Explorer as 32-bit images?
  3. Is it possible for IIS to be loading 32-bit DLLs into a 64-bit process space?
  4. If IIS is a 64-bit process, and we load a website compiled as Any CPU, will it force 32-bit if any of the DLLs it depends on are 32-bit DLLs (e.g. it was compiled against a 32-bit version of the Oracle drivers?)

Thanks in advance...


Solution

  • Process Explorer is just reporting the AnyCPU DLLs as 32 bit. There slot in the PE header that contains this information doesn't have a setting for AnyCPU so the compiler marks them as 32 bit. But rest assured that a 64 bit process will only load 64 bit DLLs, or AnyCPU DLLs which it forces into 64 bit mode.

    The native DLLs, comctl32, gdi32 are marked as 64 bit and that's proof that your process and all the code within is running as 64 bit. It's just the AnyCPU DLLs that are misleading.