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.

RE: AddPort fails when others are logged on by WeDoDrivers

WeDoDrivers
Sun Jul 08 04:16:00 CDT 2007

erasmus,
Sad to see no one replied to your post. I should read this more often.
Did you ever get a response?
What I noticed is that the spoolsv.exe is running by default with
SeTakeOwnership disabled by default, meaning that only the user which started
the spooler has full access to it.
I am curious if and how you resolved this?

-Jordan
----------------------------------
WeDoDrivers.com
"The Printer Driver Experts"
We handle any size printer driver project, large or small.


"erasmus70@gmail.com" wrote:

> 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.
>
>