reflection, COM, and Vista

I

idoublepress

Hi all,
I've been struggling with an issue that I hope you can comment on or
provide suggestions to. Our .NET 2.0 (VS2005) based product is
crashing (when the user selects a particular feature on the UI) on
Vista. It works fine on XP. In a nutshell:

- user makes a selection on the UI
- System.Reflection.MethodInfo.Invoke() calls into one of our .NET
library dlls
- Inside the library dll, System.Activator.CreateInstance() is called
to create a particular .NET class object
- Inside the constructor of the .NET class object, a Thread is created
and started
- Inside the ThreadStart method, a COM object (created in VS2003 using
C++/ATL) is created
- Inside the FinalConstruct() of the COM object, Create() is called to
create a Window (in ATLWIN.h, Win32's CreateWindowEx() is eventually
called)
- CreateWindowEx() crashes with an access violation (0xc0000005)

Again, happens only on Vista....and happens every time. XP works
fine.
I'd really appreciate your help here. Thanks!
 
M

Mr. Arnold

Hi all,
I've been struggling with an issue that I hope you can comment on or
provide suggestions to. Our .NET 2.0 (VS2005) based product is
crashing (when the user selects a particular feature on the UI) on
Vista. It works fine on XP. In a nutshell:

Again, happens only on Vista....and happens every time. XP works
fine.
I'd really appreciate your help here. Thanks!

You are aware of the Vista UAC Manifest that a program running on Vista must
use to escalate its privileges so that it has the proper permissions when
needed during program execution.

Also, you cannot expect that a solution that was built on a XP machine and
deployed to a Vista machine is going to work Vista.

One builds and deploys a solution on a XP machine to be deployed to the XP
platform. One does the same for a solution to be deployed to Vista -- XP to
XP and Vista to Vista build and deployment. Although they are both NT
classed O/S(s), Vista is different under the hood in lots of areas from a
programming standpoint.
 
C

Cor Ligthert[MVP]

One builds and deploys a solution on a XP machine to be deployed to the XP
platform. One does the same for a solution to be deployed to Vista -- XP
to XP and Vista to Vista build and deployment. Although they are both NT
classed O/S(s), Vista is different under the hood in lots of areas from a
programming standpoint.


As long as there is only Net used it should problemless go, before we get
misunderstandings

Cor
 
M

Mr. Arnold

Cor Ligthert said:
As long as there is only Net used it should problemless go, before we get
misunderstandings

That is not correct. A DLL that is dedicated to the XP platform can be
picked up in the build that is not Vista compliant and stop things from
working or the other way around if it was built on Vista and deployed XP.

It's another form of DLL he*l, which I have faced and is a major cause of
problems on the Vista platform when solutions are built for the XP platform
and deployed to Vista. You see these issues in the Vista NG with users. And
it will happen even if .Net DLL(s) are not registered in the registry.

I recall a couple years back when a .Net solution was deployed to a Citrix
Terminal Server farm, the 3rd party vendor indicating there should be no
problems with existing solutions running on the server farm, because .Net
DLL(s) are not registered. Well, that was not the case and whole lot of
things start blowing out when that solution it the farm. The solution had to
be removed.

One must face the bullet coming at one in the foxhole.
 
I

idoublepress

You are aware of the Vista UAC Manifest that a program running on Vista must
use to escalate its privileges so that it has the proper permissions when
needed during program execution.

Also, you cannot expect that a solution that was built on a XP machine and
deployed to a Vista machine is going to work Vista.

One builds and deploys a solution on a XP machine to be deployed to the XP
platform. One does the same for a solution to be deployed to Vista -- XP to
XP and Vista to Vista build and deployment. Although they are both NT
classed O/S(s), Vista is different under the hood in lots of areas from a
programming standpoint.

Thanks for replying. This issue is happening under the local
administrator account so I don't think that it's related to UAC
elevation. Any other ideas here? I was thinking that it has to be
something peculiar about Vista when doing the gyrations that I listed
above:

- user makes a selection on the UI
- System.Reflection.MethodInfo.Invoke() calls into one of our .NET
library dlls
- Inside the library dll, System.Activator.CreateInstance() is called
to create a particular .NET class object
- Inside the constructor of the .NET class object, a Thread is
created
and started
- Inside the ThreadStart method, a COM object (created in VS2003
using
C++/ATL) is created
- Inside the FinalConstruct() of the COM object, Create() is called
to
create a Window (in ATLWIN.h, Win32's CreateWindowEx() is eventually
called)
- CreateWindowEx() crashes with an access violation (0xc0000005)
 
M

Mr. Arnold

You are aware of the Vista UAC Manifest that a program running on Vista
must
use to escalate its privileges so that it has the proper permissions when
needed during program execution.

Also, you cannot expect that a solution that was built on a XP machine and
deployed to a Vista machine is going to work Vista.

One builds and deploys a solution on a XP machine to be deployed to the XP
platform. One does the same for a solution to be deployed to Vista -- XP
to
XP and Vista to Vista build and deployment. Although they are both NT
classed O/S(s), Vista is different under the hood in lots of areas from a
programming standpoint.

Thanks for replying. This issue is happening under the local
administrator account so I don't think that it's related to UAC
elevation. Any other ideas here? I was thinking that it has to be
something peculiar about Vista when doing the gyrations that I listed
above:

- user makes a selection on the UI
- System.Reflection.MethodInfo.Invoke() calls into one of our .NET
library dlls
- Inside the library dll, System.Activator.CreateInstance() is called
to create a particular .NET class object
- Inside the constructor of the .NET class object, a Thread is
created
and started
- Inside the ThreadStart method, a COM object (created in VS2003
using
C++/ATL) is created
- Inside the FinalConstruct() of the COM object, Create() is called
to
create a Window (in ATLWIN.h, Win32's CreateWindowEx() is eventually
called)
- CreateWindowEx() crashes with an access violation (0xc0000005)

--------------------------------------------------------------------------------
<copied>
The UAC team took a drastically different approach to designing the access
token creation process in Windows Vista. When an administrator user logs on
to a Windows Vista computer, two access tokens are created: a filtered
standard user access token and a full administrator access token. By
default, all users, including administrators, log on to Windows Vista as
standard users.

<copied>

So, the program can be running under an admin account up until the point
that it does something and the program's privileges must be escalated, and
it can't do so because the UAC manifest as not been addressed to say that
the running application can escalate its privileges.

Also, have you taken this application and with the .Net IDE compiled it and
ran it in debug mode on a Vista machine? I would say without doing that, you
are just shooting blanks. You cannot expect that the application that runs
on a XP is going to run on Vista without code modification. You're lucky if
that application can run on Vista without modification, but you are facing
that bullet.

The other thing you can do is turn UAC off and see if the program will run.





..
 
I

idoublepress

Thanks for replying.  This issue is happening under the local
administrator account so I don't think that it's related to UAC
elevation.  Any other ideas here?  I was thinking that it has to be
something peculiar about Vista when doing the gyrations that I listed
above:

- user makes a selection on the UI
- System.Reflection.MethodInfo.Invoke() calls into one of our .NET
library dlls
- Inside the library dll, System.Activator.CreateInstance() is called
to create a particular .NET class object
- Inside the constructor of the .NET class object, a Thread is
created
and started
- Inside the ThreadStart method, a COM object (created in VS2003
using
C++/ATL) is created
- Inside the FinalConstruct() of the COM object, Create() is called
to
create a Window (in ATLWIN.h, Win32's CreateWindowEx() is eventually
called)
- CreateWindowEx() crashes with an access violation (0xc0000005)

---------------------------------------------------------------------------­-----
<copied>
The UAC team took a drastically different approach to designing the access
token creation process in Windows Vista. When an administrator user logs on
to a Windows Vista computer, two access tokens are created: a filtered
standard user access token and a full administrator access token. By
default, all users, including administrators, log on to Windows Vista as
standard users.

<copied>

So, the program can be running under an admin account up until the point
that it does something and the program's privileges must be escalated,  and
it can't do so because the UAC manifest as not been addressed to say that
the running application can escalate its privileges.

Also, have you taken this application and with the .Net IDE compiled it and
ran it in debug mode on a Vista machine? I would say without doing that, you
are just shooting blanks. You cannot expect that the application that runs
on a XP is going to run on Vista without code modification. You're lucky if
that application can run on Vista without modification, but you are facing
that bullet.

The other thing you can do is turn UAC off and see if the program will run.

.- Hide quoted text -

- Show quoted text -

Thanks for the additional suggestions. I turned off UAC but no
luck...still crashes at the same CreateWindowEx() call. I agree being
able to debug this would be good. But this crash is in a Win32
CreateWindowEx() call...not easy to figure out what's going on.
Complicating this is that the CreateWindowEx() crash is in the
FinalConstruct() of a COM component written in VS2003. Sucks to be
me... If anyone else has any other suggestions I'd appreciate it.
 
M

Mr. Arnold

Thanks for replying. This issue is happening under the local
administrator account so I don't think that it's related to UAC
elevation. Any other ideas here? I was thinking that it has to be
something peculiar about Vista when doing the gyrations that I listed
above:

- user makes a selection on the UI
- System.Reflection.MethodInfo.Invoke() calls into one of our .NET
library dlls
- Inside the library dll, System.Activator.CreateInstance() is called
to create a particular .NET class object
- Inside the constructor of the .NET class object, a Thread is
created
and started
- Inside the ThreadStart method, a COM object (created in VS2003
using
C++/ATL) is created
- Inside the FinalConstruct() of the COM object, Create() is called
to
create a Window (in ATLWIN.h, Win32's CreateWindowEx() is eventually
called)
- CreateWindowEx() crashes with an access violation (0xc0000005)

---------------------------------------------------------------------------­-----
<copied>
The UAC team took a drastically different approach to designing the access
token creation process in Windows Vista. When an administrator user logs
on
to a Windows Vista computer, two access tokens are created: a filtered
standard user access token and a full administrator access token. By
default, all users, including administrators, log on to Windows Vista as
standard users.

<copied>

So, the program can be running under an admin account up until the point
that it does something and the program's privileges must be escalated, and
it can't do so because the UAC manifest as not been addressed to say that
the running application can escalate its privileges.

Also, have you taken this application and with the .Net IDE compiled it
and
ran it in debug mode on a Vista machine? I would say without doing that,
you
are just shooting blanks. You cannot expect that the application that runs
on a XP is going to run on Vista without code modification. You're lucky
if
that application can run on Vista without modification, but you are facing
that bullet.

The other thing you can do is turn UAC off and see if the program will
run.

.- Hide quoted text -

- Show quoted text -

Thanks for the additional suggestions. I turned off UAC but no
luck...still crashes at the same CreateWindowEx() call. I agree being
able to debug this would be good. But this crash is in a Win32
CreateWindowEx() call...not easy to figure out what's going on.
Complicating this is that the CreateWindowEx() crash is in the
FinalConstruct() of a COM component written in VS2003. Sucks to be
me... If anyone else has any other suggestions I'd appreciate it.


There are two different admin accounts on Vista. One is call the super Admin
account that has all inclusive rights, like the one on XP, and the user
Admin account which I think is still locked down to standard user, even with
UAC disable.

http://www.computerperformance.co.uk/vista/vista_administrator_activate.htm

Try that, as I still think you have a permissions issue that you may be
ignoring by the non-usage of the UAC manifest in usage by the program in
question.

Regardless as to what is happening here, you must be learning something
about Vista I would think. :)
 
I

idoublepress

Thanks for the additional suggestions.  I turned off UAC but no
luck...still crashes at the same CreateWindowEx() call.  I agree being
able to debug this would be good.  But this crash is in a Win32
CreateWindowEx() call...not easy to figure out what's going on.
Complicating this is that the CreateWindowEx() crash is in the
FinalConstruct() of a COM component written in VS2003.  Sucks to be
me...  If anyone else has any other suggestions I'd appreciate it.

There are two different admin accounts on Vista. One is call the super Admin
account that has all inclusive rights, like the one on XP,  and the user
Admin account which I think is still locked down to standard user, even with
UAC disable.

http://www.computerperformance.co.uk/vista/vista_administrator_activa...

Try that, as I still think you have a permissions issue that you may be
ignoring by the non-usage of the UAC manifest in usage by the program in
question.

Regardless as to what is happening here, you must be learning something
about Vista I would think. :)- Hide quoted text -

- Show quoted text -

I confimed that the current Administrator account that I'm using is
active using the Net User method and the Local Securit Method as
described in the link you provided above. I'm sure that I'm
definately running the super-user administrator account. XP Prof
works fine for me...just that some customers are moving to Vista so I
need to figure this CreateWindowEx crash out...makes no sense to me.
I wonder if there's just something different about how Vista does
things during window creation or if its less tolerant than XP on
certain preconditions existing during a CreateWindowsEx call? Or if
there's something in the fact that the COM object is using ATL from
VS2003 and its being used in a VS2005 based application running on
Vista? Or maybe is some weird threading/apartment issue that only
shows up in Vista? I'll keep investigating...hopefully someone out
there has seen something similar before....Thanks.
 
K

KeyPro88

I am having a very similar problem. I am using windows XP with visual studios
2005. I was able to compile my code and run it just fine until recently.

recently I started getting the 0xC0000005 exception when I call the
CreateWindowEx function. There is no explanation for this as I have not
changed the code in several months, but it simply no longer executes that
code without the exception.

I have been looking for a solution and some people seem to think that it
could be related to DirectX libraries and that re-installing the OS might
solve the issue. I have not tried that yet.

It seems likely though, since I can compile and run the code on a different
machine using visual studios 2003, and there are no problems when I do that.
This looks like some kind of recent problem for vs2005, or some library that
gets used by the CreateWindowEx function call.

I must assume there is some shared library on the vs2005 machine that has
become corrupted or otherwise useless. If anyone has a solution for this, it
would be appreciated.
 
M

manisha santwani

Hi

I am also facing the similar problem.

CreatewindowEx function throws an "Access violation" exception on Vista,
but on Win XP it works perfectly fine.
I am using Visaul Studio 6.0

If you have got any solution, please reply.

Thanks,
Manisha
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Adding COM references - error 0x80131019 1
COM Objects in VB.NET 2
Windows Vista Windows Vista 0
Calling COM Objects From C# 1
Need help with C# COM Interop, creating a DCOM server 0
What is COM, COM+ ? 7
regasm registeration COM 1
COM+ and .NET 3

Top