|
|
Hi,
i have some interessting Situation here. I started to port my Application to Windows Vista32/64 and i have some strange Situation there: On Windows 2000 and XP based System the call to SetupDiRemoveDevice(....) works just fine, but on Windows Vista based System i get a INVALID_HANDLE Error and the call fails. What i want to know is, to wich part this Error Code belongs and to what Parameter. The First Parameter is a handle to a device information set and the second is a pointer to SP_DEVINFO_DATA structure. Both Information "seems" to be valid, since it hold data and no NULL or Zero Info or something weird. Since the first parameter is a handle, at first you will think:"Ok thats it, backtrack the variable", but the second pointer to SP_DEVINFO_DATA holds a so called "opaque handle (DWORD)", a handle to a device instance. So which one is invalid? Is there a simple way to check this, to check which one is invalid?
The Application asks (while starting) for Elevation and accepts only a "real" administrator and wont start another way. So this is excluded. Addtionally it enables all possible privileges the User Token has, so this is also excluded.
Maybe important to know is that the application calls everything from the ..NET PInvoke Layer, but i had no problems so far,...it started on Vista (like many many other problems solved so far). The first thing that comes to mind is that some sort of security restriction breaks my design, but i think i would get a ACCESS_DENIED or something like YOU_ARE_NOT_ALLOWED_TO_USE_THIS_ERROR_CODE. Its just a INVALID_HANDLE,...
Any help would be really great!
Regards
Kerem
-- -- ----------------------- Beste Grüsse / Best regards / Votre bien devoue Kerem Gümrükcü Latest Project: http://www.codeplex.com/restarts Latest Open-Source Projects: http://entwicklung.junetz.de ----------------------- "This reply is provided as is, without warranty express or implied."
|
|
|
[Quoted Text] > Maybe important to know is that the application calls everything from the > .NET > PInvoke Layer
..NET is evil. :-)
Try writing a tiny command-line app in unmanaged C which will do the same.
-- Maxim S. Shatskih Windows DDK MVP maxim[ at ]storagecraft.com http://www.storagecraft.com
|
|
Hi Maxim,
[Quoted Text] >.NET is evil. :-)
I dont know, but why none here likes .NET? .NET is not evil, its just fine,...as long as you dont need any assembly involved. One restriction of the application i am working on is, that it is not allowed to have any external stuff, it just has to be one big binary. So "tiny" console or "one shot" binaries are not allowed.
Why does the application work on Windows 2000 and XP, but fails on Windows Vista? Do you have any suggestions. To be honest, i dont think thats an .NET (Layer) issue here, since it work on prior windows version just fine!
Any ideas,...?
Regards
Kerem
"Maxim S. Shatskih" <maxim[ at ]storagecraft.com.no.spam> schrieb im Newsbeitrag news:ubtjPcGPJHA.728[ at ]TK2MSFTNGP05.phx.gbl... >> Maybe important to know is that the application calls everything from the >> .NET >> PInvoke Layer > > .NET is evil. :-) > > Try writing a tiny command-line app in unmanaged C which will do the same. > > -- > Maxim S. Shatskih > Windows DDK MVP > maxim[ at ]storagecraft.com > http://www.storagecraft.com >
|
|
Well,
i finally found it and it was not what i expected. A colleague wrote some parts of the application, some classes plain to speak and he was using some undocumented functions including the SetupDiGetClassDevsEx(...) which is undocumented i found. Switching to the SetupDiGetClassDevs(...) made everything just work fine.
But SetupDiGetClassDevsEx(...) works on W2K and XP just fine, but fails with a INVALID_HANDLE_VALUE on Windows Vista. But now it has been solved. Maybe they changed internals,...obvious they did,...
Thats why i always "try to avoid undocumented stuff,....!
BTW:
Is CM_Uninstall_DevNode(Ex)(...) the same as SetupDiRemoveDevice(...)? Do you know anything,...?
Regards
Kerem
|
|
What was MachineName argument of ClassDevsEx?
"Kerem Gümrükcü" <kareem114[ at ]hotmail.com> wrote in message news:ei25NPLPJHA.2312[ at ]TK2MSFTNGP03.phx.gbl...
[Quoted Text] > Well, > > i finally found it and it was not what i expected. A colleague wrote > some parts of the application, some classes plain to speak and he > was using some undocumented functions including the > SetupDiGetClassDevsEx(...) > which is undocumented i found. Switching to the SetupDiGetClassDevs(...) > made > everything just work fine. > > But SetupDiGetClassDevsEx(...) works on W2K and XP just fine, but fails > with a INVALID_HANDLE_VALUE on Windows Vista. But now it has been > solved. Maybe they changed internals,...obvious they did,... > > Thats why i always "try to avoid undocumented stuff,....! > > BTW: > > Is CM_Uninstall_DevNode(Ex)(...) the same as SetupDiRemoveDevice(...)? > Do you know anything,...? > > Regards > > Kerem
|
|
Hi,
[Quoted Text] >What was MachineName argument of ClassDevsEx?
It was something like "\\MACHINAME". I know these backslasches are sometimes really necesssary. But the function did not return any error codes, thas the strange thing here!
Regards
Kerem
|
|
Kerem,
Kerem Gümrükcü wrote:
[Quoted Text] > Well, > > i finally found it and it was not what i expected. A colleague wrote > some parts of the application, some classes plain to speak and he > was using some undocumented functions including the > SetupDiGetClassDevsEx(...) > which is undocumented i found.
Nope, SetupDiGetClassDevsEx is documented. IIRC I used it already at W2K times.
-- Stefan
|
|
Did you actually need to call this function for a specific machine? Or it was always a current machine?
"Kerem Gümrükcü" <kareem114[ at ]hotmail.com> wrote in message news:%23FmcrARPJHA.2312[ at ]TK2MSFTNGP03.phx.gbl...
[Quoted Text] > Hi, > >>What was MachineName argument of ClassDevsEx? > > It was something like "\\MACHINAME". I know these backslasches are > sometimes really necesssary. But the > function did not return any error codes, thas the strange > thing here! > > Regards > > Kerem > >
|
|
Well,
the application mostly uses the Ex-Variants of the Functions for future remote usage,...
Regards
Kerem
"Alexander Grigoriev" <alegr[ at ]earthlink.net> schrieb im Newsbeitrag news:ezydvhSPJHA.4708[ at ]TK2MSFTNGP06.phx.gbl...
[Quoted Text] > Did you actually need to call this function for a specific machine? Or it > was always a current machine? > > "Kerem Gümrükcü" <kareem114[ at ]hotmail.com> wrote in message > news:%23FmcrARPJHA.2312[ at ]TK2MSFTNGP03.phx.gbl... >> Hi, >> >>>What was MachineName argument of ClassDevsEx? >> >> It was something like "\\MACHINAME". I know these backslasches are >> sometimes really necesssary. But the >> function did not return any error codes, thas the strange >> thing here! >> >> Regards >> >> Kerem >> >> > >
|
|
|
[Quoted Text] > involved. One restriction of the application i am working > on is, that it is not allowed to have any external stuff, it > just has to be one big binary
Yet another evil and silly requirement. Add a native unmanaged DLL there, which will wrap around the non-.NET friendly SetupDi stuff.
-- Maxim S. Shatskih Windows DDK MVP maxim[ at ]storagecraft.com http://www.storagecraft.com
|
|
..NET is extremely useful for what it was designed for - simple GUI apps. Hardly anyone here will ever work on one of those so it isn't surprising the general attitude you see ;)
"Kerem Gümrükcü" <kareem114[ at ]hotmail.com> wrote in message news:u3uq7vKPJHA.764[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text] > Hi Maxim, > >>.NET is evil. :-) > > I dont know, but why none here likes .NET? .NET is not > evil, its just fine,...as long as you dont need any assembly > involved. One restriction of the application i am working > on is, that it is not allowed to have any external stuff, it > just has to be one big binary. So "tiny" console or "one > shot" binaries are not allowed. > > Why does the application work on Windows 2000 and > XP, but fails on Windows Vista? Do you have any suggestions. > To be honest, i dont think thats an .NET (Layer) issue here, > since it work on prior windows version just fine! > > Any ideas,...? > > Regards > > Kerem > > > "Maxim S. Shatskih" <maxim[ at ]storagecraft.com.no.spam> schrieb im > Newsbeitrag news:ubtjPcGPJHA.728[ at ]TK2MSFTNGP05.phx.gbl... >>> Maybe important to know is that the application calls everything from >>> the >>> .NET >>> PInvoke Layer >> >> .NET is evil. :-) >> >> Try writing a tiny command-line app in unmanaged C which will do the >> same. >> >> -- >> Maxim S. Shatskih >> Windows DDK MVP >> maxim[ at ]storagecraft.com >> http://www.storagecraft.com>>
|
|
|
[Quoted Text] > .NET is extremely useful for what it was designed for - simple GUI apps.
Correct. It's rapid application development tool, like Delphi.
-- Maxim S. Shatskih Windows DDK MVP maxim[ at ]storagecraft.com http://www.storagecraft.com
|
|
Hello!
[Quoted Text] > .NET is extremely useful for what it was designed for - simple GUI > apps.
Sorry but this is non-sense. .NET never has been designed for simple GUI apps.
Do you know the platform you're talking about?
GP
|
|
|
[Quoted Text] > Sorry but this is non-sense. .NET never has been designed for simple GUI > apps.
I love .NET GUIs! The standard controls need a little improvement but you can create the UI in zero time (and usually it's not simple at all - in MFC you 'd need days to do all this work...).
It has a few limitations (as a Win32 wrapper) but I hope future versions of .NET will be much better. :)
|
|
try again
"GP" <no[ at ]spam.com> wrote in message news:u0ZSxAqPJHA.576[ at ]TK2MSFTNGP04.phx.gbl...
[Quoted Text] > Hello! > >> .NET is extremely useful for what it was designed for - simple GUI >> apps. > > Sorry but this is non-sense. .NET never has been designed for simple GUI > apps. > > Do you know the platform you're talking about? > > > GP >
|
|
|
[Quoted Text] > Do you know the platform you're talking about?
Surely.
Decrease in quality in lots of MS's software (rewritten to .NET) in ~Vista timeframe is a noticeable fact.
So: good tool for ASP.NET and for simple GUI apps. Good replacement for VB and Delphi, bad as a general development tool.
-- Maxim S. Shatskih Windows DDK MVP maxim[ at ]storagecraft.com http://www.storagecraft.com
|
|
On Nov 4, 11:05 pm, "Maxim S. Shatskih" <ma...[ at ]storagecraft.com.no.spam> wrote:
[Quoted Text] > Decrease in quality in lots of MS's software (rewritten to .NET) in > ~Vista timeframe is a noticeable fact.
Please cite one classic Windows app that was rewritten in .NET from XP to Vista.
|
|
I ment on recent version of .NET (in 2003) problems with big structure marshalings. It was fixed, but anyway, some problems existed ...
-- Volodymyr, blog: http://www.shcherbyna.com/ (This posting is provided "AS IS" with no warranties, and confers no rights) "Kerem Gümrükcü" <kareem114[ at ]hotmail.com> wrote in message news:u3uq7vKPJHA.764[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text] > Hi Maxim, > >>.NET is evil. :-) > > I dont know, but why none here likes .NET? .NET is not > evil, its just fine,...as long as you dont need any assembly > involved. One restriction of the application i am working > on is, that it is not allowed to have any external stuff, it > just has to be one big binary. So "tiny" console or "one > shot" binaries are not allowed. > > Why does the application work on Windows 2000 and > XP, but fails on Windows Vista? Do you have any suggestions. > To be honest, i dont think thats an .NET (Layer) issue here, > since it work on prior windows version just fine! > > Any ideas,...? > > Regards > > Kerem > > > "Maxim S. Shatskih" <maxim[ at ]storagecraft.com.no.spam> schrieb im > Newsbeitrag news:ubtjPcGPJHA.728[ at ]TK2MSFTNGP05.phx.gbl... >>> Maybe important to know is that the application calls everything from >>> the >>> .NET >>> PInvoke Layer >> >> .NET is evil. :-) >> >> Try writing a tiny command-line app in unmanaged C which will do the >> same. >> >> -- >> Maxim S. Shatskih >> Windows DDK MVP >> maxim[ at ]storagecraft.com >> http://www.storagecraft.com>>
|
|
IMO the context of this NG doesn't suppose general development tasks or problems :)
..NET as any other technology is good if you know where to apply it.
On Nov 5, 7:05 am, "Maxim S. Shatskih" <ma...[ at ]storagecraft.com.no.spam> wrote:
[Quoted Text] > > So: good tool for ASP.NET and for simple GUI apps. Good replacement for VB and Delphi, bad as a general development tool. >
-- Vadym
|
|
Hello again!
Just to clarify (this maybe the wrong topic for the kernel-dev group):
The .NET Platform is surly not a Environment that shall be used for "Low-Level" Applications. Kernel Mode Development is not possible at all, and User-Mode Windows APIs are desiged to be used in a C Environment. Allthough .NET has a strong P-Invoke Layer which allows Developers to use most API Functions (allmost all User-Mode APIs can also be called from ..NET), it takes much longer to code, and it takes much longer to test.
Using .NET for a Product that needs eighter very many or very complex APIs is of cause not a good choice.
But saying that .NET is just (another) RAD Tool (like Delphi or VB<=6) is also wrong. The .NET Platform targets all kind of environments, not only Windows GUIs. My personal Opinion is that System.Windows.Forms is one of the Modules in .NET that are not really good (in case of Performance and Resource-Usage). I cannot speak about WPF because I haven't used it until now. Microsoft has done big investments in the .NET Platform, and it still does. For very many modern Apps it is very well suited.
Like using .NET for "Low-Level" Dev-Work is a wrong choice, using C(++) for e.g. an Web-Service based Application Server or a modern Web-Application is also not very efficient.
If a Product needs some Low-Level stuff why not code them in C(++), and use COM, P-Invoke or C++/CLI to make it accessable for .NET?
GP
|
|
"Maxim S. Shatskih" <maxim[ at ]storagecraft.com.no.spam> wrote:
[Quoted Text] > >> .NET is extremely useful for what it was designed for - simple GUI apps. > >Correct. It's rapid application development tool, like Delphi.
This is shortchanging both products. Let us remember, as an example, that the entire Media Center application is a .NET application. -- Tim Roberts, timr[ at ]probo.com Providenza & Boekelheide, Inc.
|
|
|
[Quoted Text] > Please cite one classic Windows app that was rewritten in .NET from XP > to Vista.
Event Viewer
-- Maxim S. Shatskih Windows DDK MVP maxim[ at ]storagecraft.com http://www.storagecraft.com
|
|
|
[Quoted Text] >.NET as any other technology is good if you know where to apply it.
+1
This is true on most technologies :-)
-- Maxim S. Shatskih Windows DDK MVP maxim[ at ]storagecraft.com http://www.storagecraft.com
|
|
event viewer is not a managed app
-- Please do not send e-mail directly to this alias. this alias is for newsgroup purposes only. This posting is provided "AS IS" with no warranties, and confers no rights.
"Maxim S. Shatskih" <maxim[ at ]storagecraft.com.no.spam> wrote in message news:OIn3zqEQJHA.4504[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text] > Please cite one classic Windows app that was rewritten in .NET from XP > to Vista.
Event Viewer
-- Maxim S. Shatskih Windows DDK MVP maxim[ at ]storagecraft.com http://www.storagecraft.com
|
|
|
[Quoted Text] > event viewer is not a managed app
Then why is it loading lots of .NET DLLs, and the names of some of these DLLs are showing that the core of the Event Viewer UI panes is implemented in .NET?
-- Maxim S. Shatskih Windows DDK MVP maxim[ at ]storagecraft.com http://www.storagecraft.com
|
|
Hi Maxim,
well this is a good question, as far as i can see, it has two application domains and lots of .NET assembly references holding on my vista system. It really looks like a pure .NET environment but i think its more a ordinary PE image loading and using the .NET runtime, called "hosting" the runtime,....i think its something like that,...
Regards
Kerem
-- -- ----------------------- Beste Grüsse / Best regards / Votre bien devoue Kerem Gümrükcü Latest Project: http://www.pro-it-education.de/software/deviceremover Latest Open-Source Projects: http://entwicklung.junetz.de ----------------------- "This reply is provided as is, without warranty express or implied."
"Maxim S. Shatskih" <maxim[ at ]storagecraft.com.no.spam> schrieb im Newsbeitrag news:uKv4EFLUJHA.4072[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text] >> event viewer is not a managed app > > Then why is it loading lots of .NET DLLs, and the names of some of these > DLLs are showing that the core of the Event Viewer UI panes is implemented > in .NET? > > -- > Maxim S. Shatskih > Windows DDK MVP > maxim[ at ]storagecraft.com > http://www.storagecraft.com>
|
|
Kerem Gümrükcü <kareem114[ at ]hotmail.com> wrote:
[Quoted Text] > >well this is a good question, as far as i can see, it has two application >domains and lots of .NET assembly references holding on my vista system. >It really looks like a pure .NET environment but i think its more a >ordinary PE image loading and using the .NET runtime, called "hosting" >the runtime,....i think its something like that,...
Well, a managed executable *IS* an ordinary PE image.
You should be able to tell by doing "dumpbin /imports". If it is importing _CorExeMain or _CorDllMain, then it's a managed executable. -- Tim Roberts, timr[ at ]probo.com Providenza & Boekelheide, Inc.
|
|
Hi Tim,
i know that and i expressed myself a little wrong. It is a ordinary PE as you mentioned,...
Regards
K.
-- -- ----------------------- Beste Grüsse / Best regards / Votre bien devoue Kerem Gümrükcü Latest Project: http://www.pro-it-education.de/software/deviceremover Latest Open-Source Projects: http://entwicklung.junetz.de ----------------------- "This reply is provided as is, without warranty express or implied."
"Tim Roberts" <timr[ at ]probo.com> schrieb im Newsbeitrag news:psd0j4dpvrt211s5rs0kr0n2gg0272bovl[ at ]4ax.com...
[Quoted Text] > Kerem Gümrükcü <kareem114[ at ]hotmail.com> wrote: >> >>well this is a good question, as far as i can see, it has two application >>domains and lots of .NET assembly references holding on my vista system. >>It really looks like a pure .NET environment but i think its more a >>ordinary PE image loading and using the .NET runtime, called "hosting" >>the runtime,....i think its something like that,... > > Well, a managed executable *IS* an ordinary PE image. > > You should be able to tell by doing "dumpbin /imports". If it is > importing > _CorExeMain or _CorDllMain, then it's a managed executable. > -- > Tim Roberts, timr[ at ]probo.com > Providenza & Boekelheide, Inc.
|
|
|