Note that there are some explanatory texts on larger screens.

plurals
  1. POLoading native dll (32bit) in in-process wmi provider(32 bit) on 64 bit OS
    primarykey
    data
    text
    <p>I am working on a in-process wmi provider which loads a native third party library using[DllImport]. The dll locations is fixed to c:\mydllpath. Before loading the dll I set current directory to the dll loaction, in the provider's Bind() method.</p> <p>Environment.CurrentDirectory = Environment.ExpandEnvironmentVariables("%SystemDrive%") + "\mydllpath"; </p> <p>Provider is built for 'Any CPU', installed using gacutil, and installexe. </p> <p>gacutil.exe /if myprovider.dll</p> <p>installutil.exe myprovider.dll</p> <p>It is working fine in all 32 bit Windows platforms. But in 64 bit platform (tried with Windows 7 64bit), it is not working when I test from WMIC. But when I tested with WMI Code creator, it was working fine.</p> <p>After debugging I found it is throwing following error.</p> <p>System.BadImageFormatException Additional information: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)</p> <p>After searching help from internet, it was suggested to build the provider for x86. But provider built with x86 is giving another error like...</p> <p>ERROR: Code = 0x80041013 Description = Provider load failure Facility = WMI</p> <p>I also tried to load the native dlls(actually 2 dlls, and a sys file) using /linkref commandline switch, but failed because of not possible to load the sys file using /linkref.</p> <p>I wrote a test C# client application and keep all files ina same path, it was working fine. I hope I am missing some configurations for 64 bit installation.</p> <p>Any help would be really appreciated and very thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload