can't open socket in embedded that works on full XP



Michal Puczynski
07-09-2005, 09:25 PM
I am trying to open a socket using winsock under limited account (non
admin, no power-user) with WSASocket. The protocol requirements are passed
thru WSAPROTOCOL_INFO structure requesting UDP + QOS + Multicast.
That results in choosing "RSVP UDP Service Provider".
Call to WSASocket fails with code 10091. Translation of code is: WSAStartup
cannot function at this time because the underlying system it uses to
provide network services is currently unavailable.
Creation works on admin account, works on any power-user account.
Works on any account under full Windows XP (home or pro), but failes on
embedded. I've setup auditing on objects and I got "SCManager, system
object, RSVP" requested privilage bit 4.
Services are working fine. Although RSVP is in manual-run state, but
changing it to automatic and making it run before I try to create socket is
not changing anything. Again, it works on full XP with any credentials
(admin, power user or simple user doesn't matter).

I also compared privileges of two running processes on XP embedded. Under
power-user and under limited account, no differences are present, although
power-user has more privileges those are disabled.

Any ideas where the problem lies?

Michal.

Slobodan Brcin \(eMVP\)
07-09-2005, 09:25 PM
Michal,


You are probably missing some component with socket helper dll:
The easiest way to determine which one would be to use debuger in Visual Studio on your working XPP to determine what dll's are
loaded when you step over WSAStartup. Then use filter option in TD and find component(s) that contain needed dll's.

Also do you have component: ""Quality of Service RSVP"?

From SDK error 10091 is WSASYSNOTREADY:

Network subsystem is unavailable.
This error is returned by WSAStartup if the Windows Sockets implementation cannot function at this time because the underlying
system it uses to provide network services is currently unavailable. Users should check:

a.. That the appropriate Windows Sockets DLL file is in the current path.
b.. That they are not trying to use more than one Windows Sockets implementation simultaneously. If there is more than one Winsock
DLL on your system, be sure the first one in the path is appropriate for the network subsystem currently loaded.
c.. The Windows Sockets implementation documentation to be sure all necessary components are currently installed and configured
correctly.


Regards,
Slobodan





"Michal Puczynski" <michal.puczynski-remove-this@s-link.pl> wrote in message news:1ehnl43mpc8os$.vnp5zjiu92my.dlg@40tude.net...
> I am trying to open a socket using winsock under limited account (non
> admin, no power-user) with WSASocket. The protocol requirements are passed
> thru WSAPROTOCOL_INFO structure requesting UDP + QOS + Multicast.
> That results in choosing "RSVP UDP Service Provider".
> Call to WSASocket fails with code 10091. Translation of code is: WSAStartup
> cannot function at this time because the underlying system it uses to
> provide network services is currently unavailable.
> Creation works on admin account, works on any power-user account.
> Works on any account under full Windows XP (home or pro), but failes on
> embedded. I've setup auditing on objects and I got "SCManager, system
> object, RSVP" requested privilage bit 4.
> Services are working fine. Although RSVP is in manual-run state, but
> changing it to automatic and making it run before I try to create socket is
> not changing anything. Again, it works on full XP with any credentials
> (admin, power user or simple user doesn't matter).
>
> I also compared privileges of two running processes on XP embedded. Under
> power-user and under limited account, no differences are present, although
> power-user has more privileges those are disabled.
>
> Any ideas where the problem lies?
>
> Michal.

Michal Puczynski
07-09-2005, 09:25 PM
On Wed, 1 Jun 2005 11:22:29 +0200, Slobodan Brcin (eMVP) wrote:

> Michal,
>
>
> You are probably missing some component with socket helper dll:

Cannot be the case as on the same machine with admin rights creation
succeeds.

Michal.

Slobodan Brcin \(eMVP\)
07-09-2005, 09:25 PM
> Cannot be the case as on the same machine with admin rights creation
> succeeds.

You are right. I have no idea what could be wrong :-(

What SP do you use on XPe and XPP?

Regards,
Slobodan

Michal Puczynski
07-09-2005, 09:25 PM
On Wed, 1 Jun 2005 14:45:59 +0200, Slobodan Brcin (eMVP) wrote:

>> Cannot be the case as on the same machine with admin rights creation
>> succeeds.
>
> You are right. I have no idea what could be wrong :-(
>
> What SP do you use on XPe and XPP?
>
> Regards,
> Slobodan

In both cases RSVP UDP Service Provider is used.

Slobodan Brcin \(eMVP\)
07-09-2005, 09:25 PM
Michal,

> What SP do you use on XPe and XPP?

Sorry for confusion with SP. I ment whether you use same windows service pack on XPe and XPP. For instance SP2.

Regards,
Slobodan



"Michal Puczynski" <michal.puczynski-remove.this@s-link.pl> wrote in message news:6pwg96jtkuf3$.86qjwf7s30z4.dlg@40tude.net...
> On Wed, 1 Jun 2005 14:45:59 +0200, Slobodan Brcin (eMVP) wrote:
>
> >> Cannot be the case as on the same machine with admin rights creation
> >> succeeds.
> >
> > You are right. I have no idea what could be wrong :-(
> >
> > What SP do you use on XPe and XPP?
> >
> > Regards,
> > Slobodan
>
> In both cases RSVP UDP Service Provider is used.

Michal Puczynski
07-09-2005, 09:25 PM
On Wed, 1 Jun 2005 15:20:59 +0200, Slobodan Brcin (eMVP) wrote:

> Michal,
>
>> What SP do you use on XPe and XPP?
>
> Sorry for confusion with SP. I ment whether you use same windows service pack on XPe and XPP. For instance SP2.
>
> Regards,
> Slobodan
>
Oh, sorry. Both use SP2, I compared Winsock DLL's and provider DLL's, all
are the same (byte-by-byte the same).

Michal.

KM
07-09-2005, 09:25 PM
Michal,

I'd also think that there are some problems for a limited user to start "QoS
RSVP" service but you mentioned you set it to Automatic (right?) and it
didn't help.
Make sure that the [HKLM\SYSTEM\CurrentControlSet\Services\RSVP\Security]
key exists (you may want to copy it from XP Pro machine).

If the above doesn't help I don't have any good idea about the error either.
Just to suggest a couple of dead-end options:
- Do you have "Network Command Shell Interface Context" and "Primitive:
Netcfgx" components included in your configuration?
- Use Dependency Walker Profiling feature to see (and compare to XPP) if
anything is NOT loaded while you launch you test app that makes a call to
WSAStartup.
- To finish with "missing dependency" investigation you can try
XPPRoEmulation image from www.xpefiles.com that has virtually every software
component from XPe database.
(there is also "not-my" SP2 version of the project which I cannot
comment on but I have my own SP2 version here and it is really easy to get
such if you upgrade the SP1 version of the project and add a couple of new
SP2 macro components).
- Did you try monitoring the WSAStartup API call with Regmon/Filemon
tools? I think it may be worth to compare the result log with the same call
on XP Pro machine.
- Have you tried "repairing" Winsock on your image? May sound silly on
XPe but still worth to try: "netsh winsock reset".

KM

> On Wed, 1 Jun 2005 15:20:59 +0200, Slobodan Brcin (eMVP) wrote:
>
>> Michal,
>>
>>> What SP do you use on XPe and XPP?
>>
>> Sorry for confusion with SP. I ment whether you use same windows service
>> pack on XPe and XPP. For instance SP2.
>>
>> Regards,
>> Slobodan
>>
> Oh, sorry. Both use SP2, I compared Winsock DLL's and provider DLL's, all
> are the same (byte-by-byte the same).
>
> Michal.

Michal Puczynski
07-09-2005, 09:25 PM
On Wed, 1 Jun 2005 22:03:37 -0700, KM wrote:

> Michal,
>
> I'd also think that there are some problems for a limited user to start "QoS
> RSVP" service but you mentioned you set it to Automatic (right?) and it
> didn't help.
> Make sure that the [HKLM\SYSTEM\CurrentControlSet\Services\RSVP\Security]
> key exists (you may want to copy it from XP Pro machine).
>
It is about security key. All our installations miss that. I checked french
version and english. Does not matter what type of installation was it (full
or limited). It looks like setup has problems.
BTW. Do you know how to modify security for services? Not by copying
byte-strings from registry?

Thanks for help.
Michal.

KM
07-09-2005, 09:26 PM
Michal,

>> I'd also think that there are some problems for a limited user to start "QoS
>> RSVP" service but you mentioned you set it to Automatic (right?) and it
>> didn't help.
>> Make sure that the [HKLM\SYSTEM\CurrentControlSet\Services\RSVP\Security]
>> key exists (you may want to copy it from XP Pro machine).
>>
> It is about security key.

Did you check? Did adding the key help to fix the problem?

> All our installations miss that. I checked french
> version and english. Does not matter what type of installation was it (full
> or limited). It looks like setup has problems.
> BTW. Do you know how to modify security for services? Not by copying
> byte-strings from registry?

Well.. I'd recommend you to check with the byte copying first.
Also, what it says on the Log On page for the QoS RSVP service in Services UI (services.msc)?
There are some known issues on how to set up the logon security for a service data on XPe.

You can set up the service security and access rights with SCM APIs:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/service_security_and_access_rights.asp
(QueryServiceObjectSecurity/SetServiceObjectSecurity, GetNamedSecurityInfo/SetNamedSecurityInfo). Some sample code for you:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/modifying_the_dacl_for_a_service.asp.

Or use sc.exe tool (e.g.,type "sc sdshow RSVP" to see the security descriptor)

KM

Michal Puczynski
07-09-2005, 09:26 PM
I did check with byte-copying and it worked, so I wanted to get details of
how the security is set. It is a potential issue I may expect in other
scenarios, thus I wanted to know how to change security. If there is no
tool for it, then I need to write it ;-)

Thanks for help and hints.
Regards,
Michal.

KM
07-09-2005, 09:26 PM
Michal,

> I did check with byte-copying and it worked, so I wanted to get details of
> how the security is set. It is a potential issue I may expect in other
> scenarios, thus I wanted to know how to change security. If there is no
> tool for it, then I need to write it ;-)

Then, as I said, you should take a look at the sc.exe commands sdShow and sdSet.


--
Regards,
KM, BSquare Corp.


can't open socket in embedded that works on full XP