Allocating Contiguous Memory

Dear All,
I wan’t to allocate memory of size < 64k. Say now i wan’t this memory to be aligned to a 64k boundary. Iam using IoAllocateContiguousMemory call.

Say requested size is s and the pointer returned by IoAllocateContiguousMemory is p

Now p & 0xffff0000 should be equal to (p+s-1) & 0xffff0000. ie, same 64k boundary.

How can i ensure this?

Thanks,
Giri.

Use MmAllocateContiguousMemorySpecifyCache instead

/simgr

-----Original Message-----
From: Seshagiri Babu K V [mailto:xxxxx@sasken.com]
Sent: Tuesday, November 26, 2002 8:28 AM
To: NT Developers Interest List
Subject: [ntdev] Allocating Contiguous Memory

Dear All,
I wan’t to allocate memory of size < 64k. Say now i wan’t this memory to
be aligned to a 64k boundary. Iam using IoAllocateContiguousMemory call.

Say requested size is s and the pointer returned by
IoAllocateContiguousMemory is p

Now p & 0xffff0000 should be equal to (p+s-1) & 0xffff0000. ie, same 64k
boundary.

How can i ensure this?

Thanks,
Giri.

You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to %%email.unsub%%

This is defined in ntddk.h. Is there its equivalent for WDM drivers?

----- Original Message -----
From: “Graham, Simon”
To: “NT Developers Interest List”
Sent: Tuesday, November 26, 2002 9:00 PM
Subject: [ntdev] RE: Allocating Contiguous Memory

> Use MmAllocateContiguousMemorySpecifyCache instead
>
> /simgr
>
> -----Original Message-----
> From: Seshagiri Babu K V [mailto:xxxxx@sasken.com]
> Sent: Tuesday, November 26, 2002 8:28 AM
> To: NT Developers Interest List
> Subject: [ntdev] Allocating Contiguous Memory
>
>
> Dear All,
> I wan’t to allocate memory of size < 64k. Say now i wan’t this memory
to
> be aligned to a 64k boundary. Iam using IoAllocateContiguousMemory call.
>
> Say requested size is s and the pointer returned by
> IoAllocateContiguousMemory is p
>
> Now p & 0xffff0000 should be equal to (p+s-1) & 0xffff0000. ie, same 64k
> boundary.
>
> How can i ensure this?
>
> Thanks,
> Giri.
> —
> You are currently subscribed to ntdev as: xxxxx@stratus.com
> To unsubscribe send a blank email to %%email.unsub%%
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@sasken.com
> To unsubscribe send a blank email to %%email.unsub%%
>