Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Monthly Seminars at OSR Headquarters

East Coast USA
Windows Internals and SW Drivers, Dulles (Sterling) VA, 13 November 2017

Kernel Debugging & Crash Analysis for Windows, Nashua (Amherst) NH, 4 December 2017

Writing WDF Drivers I: Core Concepts, Nashua (Amherst) NH, 8 January 2018

WDF Drivers II: Advanced Implementation Techniques, Nashua (Amherst) NH, 15 January 2018


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 5  
21 Oct 17 03:21
midhun kappally
xxxxxx@gmail.com
Join Date: 23 May 2014
Posts To This List: 19
WMI Provider

This is a very general question. I am trying to create a WMI Provider. I used the sample named "InstProv", which is a microsoft provided sample available in WindowsSDK7-Samples https://github.com/pauldotknopf/WindowsSDK7-Samples/tree/master/sysmgmt/wmi/vc/in stprov What I have done: 1. I opened the sample project using visual studio 2013 and run build command. 2. I loaded the dll using the command regsvr32 InstProv.dll 3. I compiled the mof file the command mofcomp instprov.mof 4. I opened a powershelll ant typed the following command Get-WmiObject -namespace root\default InstProvSamp The result is following Name Methods Properties --------- ------- ---------- InstProvSamp {} {MyKey, MyValue} 5. Get-WmiObject -namespace root\default InstProvSamp it gives the following result __GENUS : 2 __CLASS : InstProvSamp __SUPERCLASS : __DYNASTY : InstProvSamp __RELPATH : InstProvSamp.MyKey="a" __PROPERTY_COUNT : 2 __DERIVATION : {} __SERVER : JACK-W02 __NAMESPACE : root\default __PATH : \\JACK-W02\root\default:InstProvSamp.MyKey="a" MyKey : a MyValue : 1 PSComputerName : JACK-W02 * * * ******************************************************* In a nut shell, everything works fine !!!!!!!!!!!!!!!!!!!!!!!!!!!!! Real Issue Just copy the binaries to a different machine and repeat steps 2 to 5. You can see following error on the fifth step, Get-WmiObject : Provider load failure At line:1 char:2 + Get-WmiObject -namespace root\default InstProvSamp + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand I am very curious about this issue. It is fresh sample and i did not modify anything. Any help will be much appreciated. Important Points to take are when you load dll on another machine: 1. the dll wont load on other machines, unless you change the run time library to Multi-threaded (/MT) I invite your suggestions as this is a high priority issue for me
  Message 2 of 5  
21 Oct 17 03:47
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 11654
WMI Provider

On Oct 21, 2017, at 12:20 AM, xxxxx@gmail.com <xxxxx@lists.osr.com> = wrote: >=20 > Real Issue > Just copy the binaries to a different machine and repeat steps 2 to 5. = You can see following error on the fifth step, =20 >=20 > Get-WmiObject : Provider load failure Is it possible you built a 64-bit binary and this is a 32-bit system? = Are they the same operating systems? You might see if you can find a copy of Depends.exe and run it on the = second system to see if there is some missing DLL. =E2=80=94=20 Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 3 of 5  
21 Oct 17 13:57
midhun kappally
xxxxxx@gmail.com
Join Date: 23 May 2014
Posts To This List: 19
WMI Provider

Hey Tim Thank you very much for your quick reply. >>>>>Are they the same operating systems? Yes. They are Windows 10 64 bit machines,, one with visual studio installed and other is a test machine. >>>>>>>>>You might see if you can find a copy of Depends.exe and run it on the = >>>>>>>>>second system to see if there is some missing DLL. I tried running depend.exe on both machines and obtained exactly similar results. There were two types on errors. 1. "Error opeing files. System cannot find the path specified (2").(It complaints about missing API-MS-WIN-XXX- XXX.dll files) 2."Modules with different CPU types were found". ( It complaints about lots of system DLLs like kernel32.dll,GDI32.dll,NTDLL.dll, stating that the CPU types of these DLLs are x64) Still, I did not get a clue how it works on first machine. One important Point: The sample project has only one configuration type listed under the configuration properties. I could not choose x64 while building my project. Is it better two rewrite the sample by creating an empty Dll project and building it in x64 mode? I really appreciate your help on this Thanks Midhun.k
  Message 4 of 5  
21 Oct 17 15:39
prabhakar vinayagam
xxxxxx@gmail.com
Join Date: 29 Jan 2016
Posts To This List: 103
WMI Provider

Hi midhun, Could you please check that you were building the project in release mode...to recheck it... Its look like dll missing and not executed. Regards, Prabhakar V On Sat, Oct 21, 2017 at 11:26 PM, xxxxx@gmail.com <xxxxx@lists.osr.com> wrote: > Hey Tim > Thank you very much for your quick reply. > > >>>>>Are they the same operating systems? > Yes. They are Windows 10 64 bit machines,, one with visual studio > installed and other is a test machine. > > >>>>>>>>>You might see if you can find a copy of Depends.exe and run it on > the = > >>>>>>>>>second system to see if there is some missing DLL. <...excess quoted lines suppressed...> --
  Message 5 of 5  
22 Oct 17 23:21
midhun kappally
xxxxxx@gmail.com
Join Date: 23 May 2014
Posts To This List: 19
WMI Provider

Hey Prabhakar >>>>> Could you please check that you were building the project in release >>>>> mode...to recheck it... I tried to build the project both in release mode and debug mode. In both cases, the .dll is loaded successfully. The error comes only in step no .5 Thanks Midhun.k
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 00:31.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license