Hi,

Im trying to use the api function FindFirstDevice on a pda (WinCE 5 & 6). I
have set the size of the device info structure, set the devicesearchtype to 3
(search by guid) and passed a pointer to a guid. I have also tried seraching
by name and passing a string "*".

Every time a get the error code 18. Can anyone help me?

Re: FindFirstDevice Error 18 by Bruce

Bruce
Fri Apr 11 06:28:12 PDT 2008

A code sample of what you are doing might be of help to us in helping you.

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

"Void" <Void@discussions.microsoft.com> wrote in message
news:4B5E9598-993D-416A-8541-8162D328BF8F@microsoft.com...
> Hi,
>
> Im trying to use the api function FindFirstDevice on a pda (WinCE 5 & 6).
> I
> have set the size of the device info structure, set the devicesearchtype
> to 3
> (search by guid) and passed a pointer to a guid. I have also tried
> seraching
> by name and passing a string "*".
>
> Every time a get the error code 18. Can anyone help me?
>



Re: FindFirstDevice Error 18 by Bruce

Bruce
Fri Apr 11 06:33:27 PDT 2008

This code works on a Windows CE 5.0 device. Disclaimer: I must have copied
it from someplace becuase I never use L"*" (I would have used TEXT("*") that
is my style) myself, but I don't recall where I found it.

void ListLoadedDrivers( )
{
HANDLE hDriver;
DeviceSearchType DeviceSearch;
DEVMGR_DEVICE_INFORMATION DeviceInfo;

DeviceSearch = DeviceSearchByLegacyName;
DeviceInfo.dwSize = sizeof( DEVMGR_DEVICE_INFORMATION );
hDriver = FindFirstDevice(DeviceSearch, L"*", &DeviceInfo);
if( hDriver != INVALID_HANDLE_VALUE )
{
do
{
RETAILMSG(1, (TEXT("Legacy %s Device Key %s Name %s BUS %s\n"),
DeviceInfo.szLegacyName,
DeviceInfo.szDeviceKey,
DeviceInfo.szDeviceName,
DeviceInfo.szBusName ));
} while( FindNextDevice( hDriver, &DeviceInfo ) );
FindClose( hDriver );
}

}


--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

"Void" <Void@discussions.microsoft.com> wrote in message
news:4B5E9598-993D-416A-8541-8162D328BF8F@microsoft.com...
> Hi,
>
> Im trying to use the api function FindFirstDevice on a pda (WinCE 5 & 6).
> I
> have set the size of the device info structure, set the devicesearchtype
> to 3
> (search by guid) and passed a pointer to a guid. I have also tried
> seraching
> by name and passing a string "*".
>
> Every time a get the error code 18. Can anyone help me?
>



Re: FindFirstDevice Error 18 by Paul

Paul
Fri Apr 11 08:17:46 PDT 2008

This is 18 (decimal)? Looking that up in the Error Code Lookup utility
shows "There are no more files." That's seems as likely an explanation as
any. What GUID are you passing? Maybe it's the wrong one.

Paul T.

"Void" <Void@discussions.microsoft.com> wrote in message
news:4B5E9598-993D-416A-8541-8162D328BF8F@microsoft.com...
> Hi,
>
> Im trying to use the api function FindFirstDevice on a pda (WinCE 5 & 6).
> I
> have set the size of the device info structure, set the devicesearchtype
> to 3
> (search by guid) and passed a pointer to a guid. I have also tried
> seraching
> by name and passing a string "*".
>
> Every time a get the error code 18. Can anyone help me?
>



Re: FindFirstDevice Error 18 by Void

Void
Fri Apr 11 09:15:00 PDT 2008

I just discovered while working with a different api that it was the wrong
guid. The guid that returns with WZCQueryInterface only returned the name as
opossed to
"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\Name" Passing that in manually gets
what i need.

Which brings me to my next question..how can i get the full guid?

"Paul G. Tobey [eMVP]" wrote:

> This is 18 (decimal)? Looking that up in the Error Code Lookup utility
> shows "There are no more files." That's seems as likely an explanation as
> any. What GUID are you passing? Maybe it's the wrong one.
>
> Paul T.
>
> "Void" <Void@discussions.microsoft.com> wrote in message
> news:4B5E9598-993D-416A-8541-8162D328BF8F@microsoft.com...
> > Hi,
> >
> > Im trying to use the api function FindFirstDevice on a pda (WinCE 5 & 6).
> > I
> > have set the size of the device info structure, set the devicesearchtype
> > to 3
> > (search by guid) and passed a pointer to a guid. I have also tried
> > seraching
> > by name and passing a string "*".
> >
> > Every time a get the error code 18. Can anyone help me?
> >
>
>
>

Re: FindFirstDevice Error 18 by Paul

Paul
Fri Apr 11 09:30:27 PDT 2008

You haven't told us *anything* useful since the error code! We don't know
what you're trying to do, how you're trying to do it, or what the result is.
That's a pretty small list of things work work. Why are you trying to use
FindFirstDevice? Particularly with an NDIS device GUID. What's the
purpose? You can easily use any number things along the lines of
GetAdaptersInfo to get adapter information...

Paul T.

"Void" <Void@discussions.microsoft.com> wrote in message
news:C2088580-8CC6-4713-9558-8E08700E4708@microsoft.com...
>I just discovered while working with a different api that it was the wrong
> guid. The guid that returns with WZCQueryInterface only returned the name
> as
> opossed to
> "{98C5250D-C29A-4985-AE5F-AFE5367E5006}\Name" Passing that in manually
> gets
> what i need.
>
> Which brings me to my next question..how can i get the full guid?
>
> "Paul G. Tobey [eMVP]" wrote:
>
>> This is 18 (decimal)? Looking that up in the Error Code Lookup utility
>> shows "There are no more files." That's seems as likely an explanation
>> as
>> any. What GUID are you passing? Maybe it's the wrong one.
>>
>> Paul T.
>>
>> "Void" <Void@discussions.microsoft.com> wrote in message
>> news:4B5E9598-993D-416A-8541-8162D328BF8F@microsoft.com...
>> > Hi,
>> >
>> > Im trying to use the api function FindFirstDevice on a pda (WinCE 5 &
>> > 6).
>> > I
>> > have set the size of the device info structure, set the
>> > devicesearchtype
>> > to 3
>> > (search by guid) and passed a pointer to a guid. I have also tried
>> > seraching
>> > by name and passing a string "*".
>> >
>> > Every time a get the error code 18. Can anyone help me?
>> >
>>
>>
>>



Re: FindFirstDevice Error 18 by Void

Void
Fri Apr 11 10:16:01 PDT 2008

My original intent was to use the handle to disable the wifi card. But i came
accross the api DevicePowerNotify which works perfectly if i send the entire
guid. I didnt give *anything* useful because my question was answered. Which
is also why i asked a different question..if this is inappropriate i could
start a new thread? Im new to the forum thing.

"Paul G. Tobey [eMVP]" wrote:

> You haven't told us *anything* useful since the error code! We don't know
> what you're trying to do, how you're trying to do it, or what the result is.
> That's a pretty small list of things work work. Why are you trying to use
> FindFirstDevice? Particularly with an NDIS device GUID. What's the
> purpose? You can easily use any number things along the lines of
> GetAdaptersInfo to get adapter information...
>
> Paul T.
>
> "Void" <Void@discussions.microsoft.com> wrote in message
> news:C2088580-8CC6-4713-9558-8E08700E4708@microsoft.com...
> >I just discovered while working with a different api that it was the wrong
> > guid. The guid that returns with WZCQueryInterface only returned the name
> > as
> > opossed to
> > "{98C5250D-C29A-4985-AE5F-AFE5367E5006}\Name" Passing that in manually
> > gets
> > what i need.
> >
> > Which brings me to my next question..how can i get the full guid?
> >
> > "Paul G. Tobey [eMVP]" wrote:
> >
> >> This is 18 (decimal)? Looking that up in the Error Code Lookup utility
> >> shows "There are no more files." That's seems as likely an explanation
> >> as
> >> any. What GUID are you passing? Maybe it's the wrong one.
> >>
> >> Paul T.
> >>
> >> "Void" <Void@discussions.microsoft.com> wrote in message
> >> news:4B5E9598-993D-416A-8541-8162D328BF8F@microsoft.com...
> >> > Hi,
> >> >
> >> > Im trying to use the api function FindFirstDevice on a pda (WinCE 5 &
> >> > 6).
> >> > I
> >> > have set the size of the device info structure, set the
> >> > devicesearchtype
> >> > to 3
> >> > (search by guid) and passed a pointer to a guid. I have also tried
> >> > seraching
> >> > by name and passing a string "*".
> >> >
> >> > Every time a get the error code 18. Can anyone help me?
> >> >
> >>
> >>
> >>
>
>
>