Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WDFMEMORY handle and memory buffer

0 views
Skip to first unread message

泛若不繫舟

unread,
Jun 3, 2008, 10:58:34 PM6/3/08
to
Hi all,

I'm writing a bus driver. I make child's signature by using WDFMEMORY
handle.

Is there any possible I get the same handle value with different
memory buffer at different time?

If so, using the WDFMEMORY hanle as child's signature may be risky.
^_^a

May I use systemtime to contruct PDO_IDENTIFICATION_DESCRIPTION?

Is it safe enough?

Thanks.

Ziv

Maxim S. Shatskih

unread,
Jun 4, 2008, 1:50:45 AM6/4/08
to
ExUuidCreate is the correct way for such kind of things.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma...@storagecraft.com
http://www.storagecraft.com

"?????" <ZivH...@gmail.com> wrote in message
news:d81a155e-05ca-455e...@z24g2000prf.googlegroups.com...

泛若不繫舟

unread,
Jun 4, 2008, 3:53:15 AM6/4/08
to
Thanks Maxim,

I will change my code right away. ^_^

Ziv

On 6月4日, 下午1時50分, "Maxim S. Shatskih" <ma...@storagecraft.com> wrote:
> ExUuidCreate is the correct way for such kind of things.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> ma...@storagecraft.comhttp://www.storagecraft.com
>

> "?????" <ZivHu...@gmail.com> wrote in message


>
> news:d81a155e-05ca-455e...@z24g2000prf.googlegroups.com...
>
>
>
> > Hi all,
>
> > I'm writing a bus driver. I make child's signature by using WDFMEMORY
> > handle.
>
> > Is there any possible I get the same handle value with different
> > memory buffer at different time?
>
> > If so, using the WDFMEMORY hanle as child's signature may be risky.
> > ^_^a
>
> > May I use systemtime to contruct PDO_IDENTIFICATION_DESCRIPTION?
>
> > Is it safe enough?
>
> > Thanks.
>

> > Ziv- 隱藏被引用文字 -
>
> - 顯示被引用文字 -

泛若不繫舟

unread,
Jun 4, 2008, 4:01:21 AM6/4/08
to
Hi Maxim,

ExUuidCreate is a good idea, but this function only can be called at
PASSIVE_LEVEL. >_<
I need store the signature when reporting the child is creating and
missing.
And I also need to consider about race condition when making that
signature.

Is there any good solution for that? Thanks. ^_^

Ziv

On 6月4日, 下午1時50分, "Maxim S. Shatskih" <ma...@storagecraft.com> wrote:

> ExUuidCreate is the correct way for such kind of things.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> ma...@storagecraft.comhttp://www.storagecraft.com
>

> "?????" <ZivHu...@gmail.com> wrote in message


>
> news:d81a155e-05ca-455e...@z24g2000prf.googlegroups.com...
>
>
>
> > Hi all,
>
> > I'm writing a bus driver. I make child's signature by using WDFMEMORY
> > handle.
>
> > Is there any possible I get the same handle value with different
> > memory buffer at different time?
>
> > If so, using the WDFMEMORY hanle as child's signature may be risky.
> > ^_^a
>
> > May I use systemtime to contruct PDO_IDENTIFICATION_DESCRIPTION?
>
> > Is it safe enough?
>
> > Thanks.
>

Doron Holan [MSFT]

unread,
Jun 5, 2008, 2:45:12 PM6/5/08
to
if you have a race with a uuid, you will have a race withy any other way you
use to construct an ID. a PDO_IDENTIFICATION_DESCRIPTION will be copied by
the framework, you do not need to allocate these dynamically. you might
need to allocate memory that the description points to

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"泛若不繫舟" <ZivH...@gmail.com> wrote in message
news:23f1810b-5173-48a2...@q24g2000prf.googlegroups.com...

Ziv

unread,
Jun 10, 2008, 2:31:28 AM6/10/08
to
Thanks for your reply.

Because the child is a kind of wireless device which may be trust
timeout anytime.
I need a unique signature to report a child appear and a child miss
but also considering timeout condition.

When making such signature, I need to spinlock to prevent timeout and
store the signature in the wireless device's memory object.
I report device missing when the wireless device entering timeout
state. Actually, I delete the wireless device memory object and it's
cleanup callback report device missing.

So I need to spinlock and store that signature and make sure that
signature is unique.
And I use the WDF memory handle of the wireless device as part of
signature. But I'm not sure
if there is any chance to get the same handle so quickly and make the
signature to be duplicate.

For example:

1. Wireless Device A -> Get memory handle X and show up.
2. Wireless Device A -> timeout and report missing, and delete the
memory object. (memory handle is part of signature)
3. Wireless Device B -> Get the same memory handle X(Maybe with
different buffer address) and show up.

Because step 2 and 3 are different contexts and if step 3 executed
before step 2. What happens? ^_^a

Ziv

On 6月6日, 上午2時45分, "Doron Holan [MSFT]" <dor...@online.microsoft.com>
wrote:


> if you have a race with a uuid, you will have a race withy any other way you
> use to construct an ID. a PDO_IDENTIFICATION_DESCRIPTION will be copied by
> the framework, you do not need to allocate these dynamically. you might
> need to allocate memory that the description points to
>
> d
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no rights.
>

> "泛若不繫舟" <ZivHu...@gmail.com> wrote in message

> >> - 顯示被引用文字 -- 隱藏被引用文字 -
>
> - 顯示被引用文字 -

Doron Holan [MSFT]

unread,
Jun 10, 2008, 3:19:04 PM6/10/08
to
yes, if you free the WDFMEMORY and hten allocate a new one, it could very
well have the same value as the old one.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Ziv" <ZivH...@gmail.com> wrote in message
news:22b62bcd-4b03-4560...@p39g2000prm.googlegroups.com...

0 new messages