Re: AddPort fails when others are logged on



<erasmus70@xxxxxxxxx> schrieb im Newsbeitrag
news:1180998180.471810.325970@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Here's the situation. I'm running XP and I've got two users with
admin privileges, call them A and B.

0. Boot system.
1. Log on user A.
2. Switch user (but don't log off A) to user B.
3. Run the printer driver installer which was provided (with source
code) from a third party.

Result:
The call to AddPort() fails with Windows Error 50
(ERROR_NOT_SUPPORTED).

The call which fails is: AddPort(NULL, NULL, lpMonitorName)

One wrinkle is that it appears to depend on who first logged on. For
example, if I add the following step 2.5, the error does not occur:

2.5. Switch user (but don't log off B) back to user A.

Another wrinkle is that I have a unicode-based version of the
installer which has the same problem but returns a different error
code: 5 (ERROR_ACCESS_DENIED).

The third party claims that this is a limitation of the AddPort call,
and that the question should be addressed to Microsoft.

But wouldn't that imply that, in general, if an admin user is logged
on, it's not possible for any subsequent admin user to log on and
install a printer driver? I wouldn't expect that behavior.

Thanks for any explanations or clarifications.


Hi Stranger,

maybe the admin user does have a handle opened on some
file, key or whatever and does have exclusive access with
no share permissions to some file, object, reg-key or something
like that. What about trying to run your installer with some
debugger or what about using some tool like process-explorer
or process-monitor from sysinternals to check what and who has
access to what and when. Use Regmon and/or Filemon or better
the process-monitor to see what, when and where the functions
fail. Do a stack-trace to get more info, but i think its not needed
since you know where it fails but propably it can help if there
are subsequent calls to internal functions that fail. You will have
a change to go deeper with some debugger like WinDbg. I think
it is some security problem something with handles exclusively
opened by the logged on user. With these apps you can find
the "culprit". Hope this helps,...


Beste Grüße / Best regards / Votre bien dévoué


Kerem Gümrükcü
-----------------------
"This reply is provided as is, without warranty express or implied."



.



Relevant Pages

  • AddPort fails when others are logged on
    ... Run the printer driver installer which was provided (with source ... The call which fails is: ... One wrinkle is that it appears to depend on who first logged on. ... But wouldn't that imply that, in general, if an admin user is logged ...
    (microsoft.public.win32.programmer.kernel)
  • AddPort fails when others are logged on
    ... Run the printer driver installer which was provided (with source ... The call which fails is: ... One wrinkle is that it appears to depend on who first logged on. ... But wouldn't that imply that, in general, if an admin user is logged ...
    (microsoft.public.development.device.drivers)
  • Re: My PC just broke down.... :(
    ... >> admin would probably try it. ... >>> installer is pretty stupid, and that's not a national secret really. ... Why would you expect an installer to be have a recovery utility? ... Many power users that I know shun the GUI. ...
    (comp.sys.mac.advocacy)
  • Re: Best Installation Location on Vista
    ... Windows virtualises these files writes if you not a admin user. ... For a .ini file, that not a huge problem, but for text files, or a mdb file, ... the inno installer actually does select the correct ...
    (comp.databases.ms-access)
  • Re: My PC just broke down.... :(
    ... > admin would probably try it. ... I've said that the Windows ... >> installer is pretty stupid, and that's not a national secret really. ... The fact that you don't prefer the CLI doesn't ...
    (comp.sys.mac.advocacy)

Loading