32-Bit DEVCON on 64-Bit Windows

Sometimes I wonder if I ever learn any truly enduring lessons.

I’m trying to get organized for a seminar I’ll soon be teaching. For our lab sessions, the target machines will be x86 (just to make life easier without driver signing). So I was collecting all the various DLLs and executables the students needed to copy to their test systems. 32-bit version of DEVCON, 32-bit C RTL DLLs, etc.

As I was testing things out in my 64-bit VM, I couldn’t get DEVCON to install my driver:

C:\lab> devcon install nothing_kmdf.inf root\nothing
devcon failed

Nothing in setupaspi.dev.log, of course.

Being annoyed, and being under time pressure, I made some excellent decisions… like issuing the above command over and over again. And, you know… renaming the INF file (because THAT was likely to be the problem).

I couldn’t imagine what the problem could be… Devcon worked FINE for various queries I issued.

FINALLY, I recalled this thread from years back:

http://www.osronline.com/showthread.cfm?link=153168

32-bit DEVCON doesn’t work on 64-bit Windows. And – while the test systems will be running 32-bit Windows for my class, *MY* test system here in the office is a 64-bit Windows system.

Sigh.

The point of this little story: I don’t know who the maintainer of DEVCON is, but wouldn’t it be wonderful if the 32-bit version printed a message that it doesn’t work for installing drivers on 64-bit systems? All I’m asking for is something like the following where “Devcon failed” is printed out:

BOOL uselessParameter;
if IsWow64Process(GetCurrentProcess(), &uselessParameter) {
printf(“32-bit Devcon can’t install drivers on 64-bit Windows\n”);
}

Peter
OSR

Yes, you are correct sir and all of us have surely banged our head on this one. I know I have. And the other thing they need to fix is auto elevate devcon to admin so a limited user doesn’t get a similar useless error message.

:rant on

I hate it when someone saves a few hours on their job and chooses to dump years of cumulative headaches on the poor users like this. People who make such decisions have no business writing software in my opinion. As a whole, Microsoft habitually makes their software unnecessarily difficult, error prone, and proprietary. What I would give to overhaul the verifier UI so it could be configured in just a few efficient clicks instead of the ridiculous “wizard” time waster we all have to trudge through on every new install. And ever tried to install the WLK on an OS it doesn’t support? Good luck figuring that out. And wbemtest, don’t get me started. Google would never release such terrible usability in their products.

:rant off

I ran into the same sort of mess with the UsbView sample app. The app does
not elevate itself in the current win8 WDK version, so it just uselessly
runs and does nothing and doesn’t bother to indicate why. Then you have an
‘aha’ moment and recall that you can convince VS to embed an elevate me
request in the app manifest so you do that and then you attempt to run the
app again in the debugger in VS and it instantly complains because, of
course, VS isn’t elevated so it can’t debug elevated apps so you have to
restart VS which of course is about the last thing you ever want to do with
VS. And since you are actually running the whole thing on a test machine
your network shares where the actual source code resides don’t exist in
your elevated instantiation of VS …

But then some other misfortunate programmer wanders over and asks why their
service is failing to find a registry key and because you are in “MSFT
programming misfortunes” mode you immediately realize that it only fails in
64bit mode and that is because their 32bit service is delightfully being
redirected to the useless 32bit registry ghetto. So you get to fix their
problem and look like a wizard and all because you were in MSFT annoyance
mode.

Such is life.

Mark Roddy

On Tue, Sep 10, 2013 at 8:24 PM, wrote:

> Yes, you are correct sir and all of us have surely banged our head on this
> one. I know I have. And the other thing they need to fix is auto elevate
> devcon to admin so a limited user doesn’t get a similar useless error
> message.
>
> :rant on
>
> I hate it when someone saves a few hours on their job and chooses to dump
> years of cumulative headaches on the poor users like this. People who make
> such decisions have no business writing software in my opinion. As a whole,
> Microsoft habitually makes their software unnecessarily difficult, error
> prone, and proprietary. What I would give to overhaul the verifier UI so it
> could be configured in just a few efficient clicks instead of the
> ridiculous “wizard” time waster we all have to trudge through on every new
> install. And ever tried to install the WLK on an OS it doesn’t support?
> Good luck figuring that out. And wbemtest, don’t get me started. Google
> would never release such terrible usability in their products.
>
> :rant off
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Mark Roddy wrote:

But then some other misfortunate programmer wanders over and asks why
their service is failing to find a registry key and because you are in
“MSFT programming misfortunes” mode you immediately realize that it
only fails in 64bit mode and that is because their 32bit service is
delightfully being redirected to the useless 32bit registry ghetto. So
you get to fix their problem and look like a wizard and all because
you were in MSFT annoyance mode.

Exactly. With each new system release, the operating system is lying to
us more and more. It started with the silly system32/syswow64 rewriting
nonsense (try explaining to someone that “no, 32-bit DLLs go in
syswow64, and 64-bit DLLs go in system32”), and moved to a new level of
nonsense with registry redirection, which exists in at least two
different variations.

And it continues. I was absolutely gobsmacked to learn that the
GetVersionEx API, which was specifically introduced to tell the truth
about operating system versions, has ALSO been modified to lie to us.
In Windows 8.1, GetVersionEx returns 6.2.9200, which is the version
number for Windows 8.0. The explanations offered on the forum for this
were asinine. I just want my application to print the current system
version number. Microsoft has now made that impossible. I thought the
golden rule was “never introduce a change that breaks existing
applications”, but that is EXACTLY what this lie does.

Windows is becoming a tangled and unmaintainable web of automated deceit.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

> Sometimes I wonder if I ever learn any truly enduring lessons.

Sorry Peter, but what is lessons for you is support issues for my employer (ending at me sometimes). :slight_smile:

WOW64 SETUPAPI.DLL is just plain defunct. Probably the issue is that it tries to access important FS/registry locations without switching off WOW64 redirection. Probably something even more serious.

So, any code using SETUPAPI on a x64 OS MUST be x64.

You cannot use SETUPAPI from 32bit app on 64bit OS.

This is not only about devcon (I wrote my own version of it to install our kernel mode stuff, and yes, under pressure from the support guys, I just fail early in this tool if the 32bit version of it is being running on x64 OS).

I think this was discussed on this forum once or twice several years ago.

More so: same story is with VSS. Any VSS-related stuff on x64 OS must be x64 itself.

On usual (non-Server-Core) Windows Server, WOW64 VSS stuff just lacks some COM proxy/stub registration. On Server Core, it lacks the 32bit versions of the DLLs themselves :slight_smile:

I would expect some more MS’s subsystems to be such.

And, on Srv2012, IIRC the whole WOW64 is an optional package.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

>Google would never release such terrible usability in their products.

Well, I would say, Bucketoid sucks in usability compared to both WP7/WinRT and iOS.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

Wow… I didn’t intend for this to turn into a heated rant thread.

All I intended was to share my stupidity/frustration and how it could have been avoided by a dev who knew that there was a function named IsWow64Process()…

You know, the genesis of utilities like devcon and USBView is typically a test dev who writes a little utility for his/her own use and later decides it might be useful to the community, so he releases it as part of the WDK tools. Or something like that. And then these utilities take on a life of their own, and we have expectations beyond the original design.

ANYhow…


I was absolutely gobsmacked to learn that the
GetVersionEx API, which was specifically introduced to tell the truth
about operating system versions, has ALSO been modified to lie to us.

[/quote]


Not that it should matter to your point, but you DO realize that GetVersionEx is officially deprecated starting in 8.1, right?

Peter
OSR

xxxxx@osr.com wrote:


> I was absolutely gobsmacked to learn that the
> GetVersionEx API, which was specifically introduced to tell the truth
> about operating system versions, has ALSO been modified to lie to us.
>
[/quote]

>
> Not that it should matter to your point, but you DO realize that GetVersionEx is officially deprecated starting in 8.1, right?

Oh, now you’ve done it. I was going to let this lie (I’ve already
whined in the MSDN forums about this), but you’ve poked me.

Here’s a use case. Very often, I put version information in the about
box of my tools: driver version, app version, plugin version, operating
system version, etc. I can ask the client to cut-and-paste that to me.
Let’s say I had done that in 1997, using the relatively new, newly
blessed, and extremely simple API GetVersionEx (which in itself was a
replacement for an earlier flawed API). That binary could still work to
this day. But, in a Windows 8.1 system, that binary is BROKEN because
it is going to display incorrect information. I CANNOT get accurate
version information in a way that works in both Windows 7 and Windows
8. If that’s not an “app compatibility” failure, then I don’t know what
the term means.

Yes, I know it is deprecated, and doing so is PATENTLY STUPID. There is
no good reason for it. None of the developers who responded on the
forums gave anything even remotely approaching a reason. There answers
were always “Well, what do you need it for?” That’s absolutely the
wrong question. Instead, WE ought to be asking “why did you change
this?” The replacement APIs don’t provide any additional information.

I think I need a Scotch.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

> You know, the genesis of utilities like devcon

DEVCON yes, but the actual issue is in SetupAPI


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

Years ago, Microsoft made it a point to support existing apps, in spite of
the fact that many of them violated the existing documentation and did
undocumented and patently stupid things. A lot of this is documented in
“The Old New Thing”. The new point is to break existing code, and if it
breaks, even if you are using documented and supported mechanisms, the
answer is “We have no obligation to support any API we feel like
deprecating, and it’s your own fault if you don’t want to deal with it”.
Which presumes we can fix every binary we get. It is not clear why so
many things have suddenly stopped working, or at least working according
to their previous documentation, other than the Win8 idea that “Everything
we did before this was wrong, welcome to the Brave New World”. Which is
why I’m still living on Win7. And I’m glad I’m retired.
joe

xxxxx@osr.com wrote:
>
>> I was absolutely gobsmacked to learn that the
>> GetVersionEx API, which was specifically introduced to tell the truth
>> about operating system versions, has ALSO been modified to lie to us.
>>
[/quote]

>>
>> Not that it should matter to your point, but you DO realize that
>> GetVersionEx is officially deprecated starting in 8.1, right?
>
> Oh, now you’ve done it. I was going to let this lie (I’ve already
> whined in the MSDN forums about this), but you’ve poked me.
>
> Here’s a use case. Very often, I put version information in the about
> box of my tools: driver version, app version, plugin version, operating
> system version, etc. I can ask the client to cut-and-paste that to me.
> Let’s say I had done that in 1997, using the relatively new, newly
> blessed, and extremely simple API GetVersionEx (which in itself was a
> replacement for an earlier flawed API). That binary could still work to
> this day. But, in a Windows 8.1 system, that binary is BROKEN because
> it is going to display incorrect information. I CANNOT get accurate
> version information in a way that works in both Windows 7 and Windows
> 8. If that’s not an “app compatibility” failure, then I don’t know what
> the term means.
>
> Yes, I know it is deprecated, and doing so is PATENTLY STUPID. There is
> no good reason for it. None of the developers who responded on the
> forums gave anything even remotely approaching a reason. There answers
> were always “Well, what do you need it for?” That’s absolutely the
> wrong question. Instead, WE ought to be asking “why did you change
> this?” The replacement APIs don’t provide any additional information.
>
> I think I need a Scotch.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

> but the actual issue is in SetupAPI

That is no excuse to release poorly written software around it. I don’t think we would be in business long if we just blamed an API and stood by and did nothing as innocent users got stuck in these traps due to no fault of their own.

It is not clear why so many things have suddenly stopped working,
or at least working according to their previous documentation,
other than the Win8 idea that “Everything we did before this was
wrong, welcome to the Brave New World”.

Isn’t it ironic that Windows 8.x can be installed in virtual machines from 3rd parties like virtualbox & vmware, but completely fails to install in Windows Virtual PC and Microsoft does not seem to care and apparently will not provide any solution for this. I’ve been developing drivers for Windows since the beginning and there have been some good advances over time to be sure, but also can’t help but notice in many ways development tools are deteriorating.

(Quote)
Oh, now you’ve done it.
(/Quote)

LOL… Sorry Tim. I saw your post over on MSDN only *after* I replied to you here. Deciding to “shim” GetVersionEx unless you explicitly manifest support for 8.1 does seem like a pretty bad idea. The idea of changing what this function returns based on your apps settings doesn’t pass the giggle test, if you ask me.

/deletes annoyed reply to Dr. Joe in the interest of overall civility and harmony.

Peter
OSR

> to their previous documentation, other than the Win8 idea that "Everything

we did before this was wrong, welcome to the Brave New World"

Can AppCompat tools help?


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

> Isn’t it ironic that Windows 8.x can be installed in virtual machines from 3rd parties like virtualbox &

vmware, but completely fails to install in Windows Virtual PC

Win8 is fine on Hyper-V 2008 R2 (except the events logged on host that the guest wants to use the newer version of virtual NIC protocol).


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

I missed this post last night:

Ironic? Not at all.

I wonder why you care? One can consider Virtual PC either an outdated product or a niche product (for supporting XP Mode). But you certainly can’t consider it a current, mainstream, product. And you can’t say anybody uses it for anything important, except *maybe* XP mode on some corporate systems.

You want a VM system from Microsoft? There’s Hyper-V. Otherwise, do what everyone else does and cough-up the money for a few VMWare licenses.

SERIOUSLY dude? The DRIVER development tools are DETERIORATING?

Back in the day you were using sources/dirs/build… a hack dating back to 1989 (literally) that had been enshrined as a process.

Today you develop drivers using Visual Studio. You hit a key, and a signed driver package is created for you. That, to me, is a lot of progress.

You might not LIKE Visual Studio, or its editor, or the capital letters in the menus… but no matter what, I can’t see how ANYone can say with honesty that “the development tools are deteriorating.”

Peter
OSR

Visual Studio 2012 kick major ass in general, and for drivers in particular. Just the feature of live source validation as you edit is a big timesaver.

Its Windows 8 look, though, is reminding me of XWindow based OpenWin ca 1995.

Of course, you want to disable the uppercase menu, by using the registry hack.

> What I would give to overhaul the verifier UI so it could be configured in just a few efficient clicks instead of the ridiculous “wizard” time waster we all have to trudge through on every new install.

What’s wrong with using the command line?

verifier.exe /standard /driver mydrv.sys

There is a free extension for VS2012 called vscommands that allows normal
case menus, running elevate by default (debugging local UM code) and some
other features. That and Microsoft’s productivity power tools, especially
the enhanced scroll bar, solve the vast majority of the cumbersome tasks for
me

wrote in message news:xxxxx@ntdev…

Visual Studio 2012 kick major ass in general, and for drivers in particular.
Just the feature of live source validation as you edit is a big timesaver.

Its Windows 8 look, though, is reminding me of XWindow based OpenWin ca
1995.

Of course, you want to disable the uppercase menu, by using the registry
hack.

Is this documented somewhere!? It would be one thing for MS to shim this
API for specific applications (a la the app compat shims + compatibility
mode), but to simply depreciate it and break it at the same time!?

the only possible reason I can think of is that they are trying to reduce
the work they need to do to produce app compat shims and this API is one
that frequently needs to be shimmed on account of incorrect version checks.
even this reason seems invalid though as compatibility mode already exists

wrote in message news:xxxxx@ntdev…

(Quote)
Oh, now you’ve done it.
(/Quote)

LOL… Sorry Tim. I saw your post over on MSDN only *after* I replied to
you here. Deciding to “shim” GetVersionEx unless you explicitly manifest
support for 8.1 does seem like a pretty bad idea. The idea of changing what
this function returns based on your apps settings doesn’t pass the giggle
test, if you ask me.

/deletes annoyed reply to Dr. Joe in the interest of overall civility and
harmony.

Peter
OSR

> SERIOUSLY dude? The DRIVER development tools are DETERIORATING?

I thought your opening post illustrated pretty well. Devcon does not cope well with the emergence of 64-bit processors and limited users. I don’t know what you call it, but I will say it in all caps to emphasize my position. I call that DETERIORATING.

Today you develop drivers using Visual Studio

Hey that’s a good one. Do you remember in the very same sentence when I wrote “there have been some good advances over time to be sure”? I have always advocated VS for driver development despite experts scoffing that it made no sense, would never work, and never be supported.

One can consider Virtual PC either an outdated product

Really? Windows Virtual PC is in fact a new product starting with Windows 7. It apparently will never handle Windows 8 guests. That’s pretty rapid deterioration.

There’s Hyper-V

It doesn’t run on my Windows 7 development machine.

You want a VM system from Microsoft?

Yes, and I will tell you why. I have used Windows Virtual PC it and its predecessors for driver development for years and years and loved them (past tense). Shame to see such a nice tool go away. I hate having to go to 3rd parties, but at least in this case there are very good options to choose from.