RamDisk questions

Hi,

I have a couple of questions about the KMDF Ramdisk sample.

  1. Is it possible to create more than one ramdisk device? Since this is a software-only driver, how will the PnP manager know to call EvtDeviceAdd, and can we control how many times it is called?

  2. RamDisk assigns a hard-coded drive letter using WdfDeviceCreateSymbolicLink(…, “\DosDevices\R:”); Is it possible to have windows automatically specify a drive letter to the disk created by RamDisk?

Regards,
Mridul.

  1. there are two ways to do this.
    a) you install more than one root enumerated ramdisk instance. You do this the same way you installed the first one, using devcon install or the add new hw wiz

b) you write a bus driver and then the bus enumerates ram disks on demand. This is needed if the driver itself determines a new ram disk is needed. if the app is deciding if a new ramdisk is required, a) is sufficient

  1. you need to support the mountmgr IOCTLs and interface with the mount manager so it will give you a letter

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@mediafour.com
Sent: Wednesday, January 14, 2009 1:26 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] RamDisk questions

Hi,

I have a couple of questions about the KMDF Ramdisk sample.

  1. Is it possible to create more than one ramdisk device? Since this is a software-only driver, how will the PnP manager know to call EvtDeviceAdd, and can we control how many times it is called?

  2. RamDisk assigns a hard-coded drive letter using WdfDeviceCreateSymbolicLink(…, “\DosDevices\R:”); Is it possible to have windows automatically specify a drive letter to the disk created by RamDisk?

Regards,
Mridul.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thank you so much for the quick responses.

Regards,
Mridul.

Sorry for cutting into your thread, but I have a question related to (2) that you may find helpful.

I try to register the mounted device interface for the RAM Disk device, but get STATUS_INVALID_DEVICE_REQUEST (C0000010L)

In EvtDeviceAdd:

UNICODE_STRING interfaceName;
// Get a pointer to the device object
PDEVICE_OBJECT DeviceObject = WdfDeviceWdmGetDeviceObject(Device);
// I try WdfDeviceWdmGetPhysicalDevice but it returns a null pointer

// Register a mnt man interface for this device
status = IoRegisterDeviceInterface(DeviceObject, // Ptr to dev obj
&MOUNTDEV_MOUNTED_DEVICE_GUID, // Interface Class GUID for mnt mgr
NULL, // ref string not used here
&interfaceName); // (OUT) symlink to the created interface.

You need to pass the PDO, not your devobj. And you don’t need to register the interface yourself, just call WdfDeviceCreateDeviceInterface(Device, MOUNTDEV_MOUNTED_DEVICE_GUID, NULL)

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Wednesday, January 14, 2009 4:48 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] RamDisk questions

Sorry for cutting into your thread, but I have a question related to (2) that you may find helpful.

I try to register the mounted device interface for the RAM Disk device, but get STATUS_INVALID_DEVICE_REQUEST (C0000010L)

In EvtDeviceAdd:

UNICODE_STRING interfaceName;
// Get a pointer to the device object
PDEVICE_OBJECT DeviceObject = WdfDeviceWdmGetDeviceObject(Device);
// I try WdfDeviceWdmGetPhysicalDevice but it returns a null pointer

// Register a mnt man interface for this device
status = IoRegisterDeviceInterface(DeviceObject, // Ptr to dev obj
&MOUNTDEV_MOUNTED_DEVICE_GUID, // Interface Class GUID for mnt mgr
NULL, // ref string not used here
&interfaceName); // (OUT) symlink to the created interface.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

> status = IoRegisterDeviceInterface(DeviceObject, // Ptr to dev obj

This can only be done for a PDO.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

WdfDeviceCreateDeviceInterface worked. The driver gets the Mounted device IOCTL. Thanks.

I’m really confused about these PDOs, FDOs. How do I find the PDO for the RAM Disk devobj? as I understand it is a software driver and does not have any hardware.

Which sample codes are good for learning about PDO and FDO?

You need to read the wdm docs if you want to understand the difference between a PDO, FDO or filter device objects. Even if your device is a software driver, every pnp stack needs a PDO. As such, there is a special bus driver built into the kernel itself, the root bus, which can create a PDO on which your software will load.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Thursday, January 15, 2009 10:52 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] RamDisk questions

WdfDeviceCreateDeviceInterface worked. The driver gets the Mounted device IOCTL. Thanks.

I’m really confused about these PDOs, FDOs. How do I find the PDO for the RAM Disk devobj? as I understand it is a software driver and does not have any hardware.

Which sample codes are good for learning about PDO and FDO?


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

I am working with Microsoft Windows 2000 sample ramdisk driver. The source has limitation in size of ramdisk. But I want to increase the size more than 128 mb up to 4gb. I’ve done so much googling but found no solution related with this.
How could I proceed?

Thanks in advance.

On a 32 bit os a 4 gb ram disk backed by the same sized alloc is impossible

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: xxxxx@yahoo.com
Sent: Wednesday, January 21, 2009 9:56 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] RamDisk questions

I am working with Microsoft Windows 2000 sample ramdisk driver. The source has limitation in size of ramdisk. But I want to increase the size more than 128 mb up to 4gb. I’ve done so much googling but found no solution related with this.
How could I proceed?

Thanks in advance.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hi Holan,
Thanks for your quick reply.
Actually I mean that how can I increase the size of ramdisk more than 128 mb assuming that system memory is 4gb. There are some software that can do that like cenetak.

It seems that I have to allocate memory from the paged pool instead of using
non-paged memory.

devExt->DiskImage = ExAllocatePoolWithTag(
??? PagedPool,
??? devExt->DiskRegInfo.DiskSize,
??? RAMDISK_TAG_DISK);
if(pDiskEx->DiskImage)
{
? pDiskEx->DiskMDL = IoAllocateMdl( pDiskEx->DiskImage,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pDiskEx->Parameters.DiskSize,
??? FALSE, FALSE, NULL);
if(pDiskEx->DiskMDL)
{
??? MmProbeAndLockPages(pDiskEx->DiskMDL, KernelMode,IoModifyAccess);
}

Problem is that IoAllocateMdl has limitation in size up to 64mb. Is there any alternativeway? How could I proceed?

Thanks again.

— On Wed, 1/21/09, Doron Holan wrote:
From: Doron Holan
Subject: RE: RE:[ntdev] RamDisk questions
To: “Windows System Software Devs Interest List”
Date: Wednesday, January 21, 2009, 10:11 PM

On a 32 bit os a 4 gb ram disk backed by the same sized alloc is impossible

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: xxxxx@yahoo.com
Sent: Wednesday, January 21, 2009 9:56 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] RamDisk questions

I am working with Microsoft Windows 2000 sample ramdisk driver. The source has
limitation in size of ramdisk. But I want to increase the size more than 128 mb
up to 4gb. I’ve done so much googling but found no solution related with
this.
How could I proceed?

Thanks in advance.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

The ramdisk can go over 64M by editing the settings as described in:
http://support.microsoft.com/kb/67321/

For instance, for a ramdisk between 256 and 511 MB, you have to specify
"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Ramdisk\Parameters]
“DiskSize”=dword:18000000
“SectorsPerCluster”=dword:00000010
"
This works properly on Vista 32 where the memory limits for NP Pool are not defined. In previous versions, the limit is 256 MB.
http://msdn.microsoft.com/en-us/library/aa366778(VS.85).aspx

You will also have to modify the sample by specifying the number of Huge Sectors inside the RamDiskFormatDisk() function:
if( devExt->DiskRegInfo.DiskSize/devExt->DiskGeometry.BytesPerSector < 65536 ) {
bootSector->bsSectors = (USHORT)(devExt->DiskRegInfo.DiskSize /
devExt->DiskGeometry.BytesPerSector);
} else {
bootSector->bsSectors = 0;
bootSector->bsHugeSectors = devExt->DiskRegInfo.DiskSize /
devExt->DiskGeometry.BytesPerSector;
}
bootSector->bsMedia = (UCHAR)devExt->DiskGeometry.MediaType;

— On Thu, 1/22/09, Ashraf wrote:

> From: Ashraf
> Subject: RE: RE:[ntdev] RamDisk questions
> To: “Windows System Software Devs Interest List”
> Date: Thursday, January 22, 2009, 12:39 PM
> Hi Holan,
> Thanks for your quick reply.
> Actually I mean that how can I increase the size of ramdisk
> more than 128 mb assuming that system memory is 4gb. There
> are some software that can do that like cenetak.
>
> It seems that I have to allocate memory from the paged pool
> instead of using
> non-paged memory.
>
> devExt->DiskImage = ExAllocatePoolWithTag(
> ???
> PagedPool,
> ???
> devExt->DiskRegInfo.DiskSize,
> ???
> RAMDISK_TAG_DISK);
> if(pDiskEx->DiskImage)
> {
> ? pDiskEx->DiskMDL = IoAllocateMdl(
> pDiskEx->DiskImage,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
> pDiskEx->Parameters.DiskSize,
> ???
> FALSE, FALSE, NULL);
> if(pDiskEx->DiskMDL)
> {
> ??? MmProbeAndLockPages(pDiskEx->DiskMDL,
> KernelMode,IoModifyAccess);
> }
>
> Problem is that IoAllocateMdl has limitation in size up to
> 64mb. Is there any alternativeway? How could I proceed?
>
> Thanks again.
>
>
> — On Wed, 1/21/09, Doron Holan
> wrote:
> From: Doron Holan
> Subject: RE: RE:[ntdev] RamDisk questions
> To: “Windows System Software Devs Interest List”
>
> Date: Wednesday, January 21, 2009, 10:11 PM
>
> On a 32 bit os a 4 gb ram disk backed by the same sized
> alloc is impossible
>
> d
>
> Sent from my phone with no t9, all spilling mistakes are
> not intentional.
>
> -----Original Message-----
> From: xxxxx@yahoo.com
> Sent: Wednesday, January 21, 2009 9:56 PM
> To: Windows System Software Devs Interest List
>
> Subject: RE:[ntdev] RamDisk questions
>
>
> I am working with Microsoft Windows 2000 sample ramdisk
> driver. The source has
> limitation in size of ramdisk. But I want to increase the
> size more than 128 mb
> up to 4gb. I’ve done so much googling but found no
> solution related with
> this.
> How could I proceed?
>
> Thanks in advance.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars
> visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online
> at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars
> visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online
> at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars
> visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online
> at http://www.osronline.com/page.cfm?name=ListServer

This topic has been covered many times on this list, please search
the archives.

Try reading up on memory pool limitations, a good starting point
http://blogs.technet.com/askperf/archive/2007/03/07/memory-management-understanding-pool-resources.aspx

I understand that Microsoft rue the day they put the ramdisk sample
in the DDK because so many Unix/Linux programmers used to the RAM
disk paradigm end up trying to pervert the way Windows works.

As a simple answer to your question, though I think you’re probably
heading down the wrong track as it is, have you actually thought
about allocating multiple extents and logically chaining them together ?

For any large RAM disk implementation you need to be on 54-bit Windows.

Mark.

At 10:39 22/01/2009, Ashraf wrote:

Hi Holan,
Thanks for your quick reply.
Actually I mean that how can I increase the size of ramdisk more
than 128 mb assuming that system memory is 4gb. There are some
software that can do that like cenetak.

It seems that I have to allocate memory from the paged pool instead
of using non-paged memory.

devExt->DiskImage = ExAllocatePoolWithTag(
PagedPool,
devExt->DiskRegInfo.DiskSize,
RAMDISK_TAG_DISK);
if(pDiskEx->DiskImage)
{
pDiskEx->DiskMDL = IoAllocateMdl( pDiskEx->DiskImage,
pDiskEx->Parameters.DiskSize,
FALSE, FALSE, NULL);
if(pDiskEx->DiskMDL)
{
MmProbeAndLockPages(pDiskEx->DiskMDL, KernelMode,IoModifyAccess);
}

Problem is that IoAllocateMdl has limitation in size up to 64mb. Is
there any alternativeway? How could I proceed?

Thanks again.

— On Wed, 1/21/09, Doron Holan wrote:
>From: Doron Holan
>Subject: RE: RE:[ntdev] RamDisk questions
>To: “Windows System Software Devs Interest List”
>Date: Wednesday, January 21, 2009, 10:11 PM
>
>
>On a 32 bit os a 4 gb ram disk backed
>
> by the same sized alloc is impossible
>
>
>d
>
>
>Sent from my phone with no t9, all spilling mistakes are not intentional.
>
>
>-----Original Message-----
>
>From: xxxxx@yahoo.com
>
>Sent: Wednesday, January 21, 2009 9:56 PM
>
>To: Windows System Software Devs Interest List
>
>Subject: RE:[ntdev] RamDisk questions
>
>
>
>I am working with Microsoft Windows 2000 sample ramdisk driver. The source has
>
>limitation in size of ramdisk. But I want to increase the size more
>than 128 mb
>
>up to 4gb. I’ve done so much googling but found no solution related with
>
>this.
>
>How could I proceed?
>
>
>Thanks in advance.
>
>
>—
>
>NTDEV is sponsored by OSR
>
>
>For our schedule of WDF, WDM, debugging and other seminars visit:
>
>http://www.osr.com/seminars
>
>
>To unsubscribe, visit the List Server section of OSR Online
>
> at
>
>http://www.osronline.com/page.cfm?name=ListServer
>
>
>
>—
>
>NTDEV is sponsored by OSR
>
>
>For our schedule of WDF, WDM, debugging and other seminars visit:
>
>http://www.osr.com/seminars
>
>
>To unsubscribe, visit the List Server section of OSR Online at
>
>http://www.osronline.com/page.cfm?name=ListServer
>
>— NTDEV is sponsored by OSR For our schedule of WDF, WDM,
>debugging and other seminars visit: http://www.osr.com/seminars To
>unsubscribe, visit the List Server section of OSR Online at
>http://www.osronline.com/page.cfm?name=ListServer

>Problem is that IoAllocateMdl has limitation in size up to 64mb. Is there any alternativeway?

Allocate several MDLs.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

>I am working with Microsoft Windows 2000 sample ramdisk driver.

Are you really sure that ramdisk is faster then usual disk on a machine with plenty of RAM for the cache?

Have you tried?


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

How several MDLs could be allocated for a specific disk image. Would you?give?a sample?or hints?plz. Actually this is the first time?I am doing with driver.
?
Thanks again.

— On Thu, 1/22/09, Maxim S. Shatskih wrote:

From: Maxim S. Shatskih
Subject: Re:[ntdev] RE:RamDisk questions
To: “Windows System Software Devs Interest List”
Date: Thursday, January 22, 2009, 4:16 AM

>Problem is that IoAllocateMdl has limitation in size up to 64mb. Is there
any alternativeway?

Allocate several MDLs.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Ashraf wrote:

How several MDLs could be allocated for a specific disk image. Would
you give a sample or hints plz. Actually this is the first time I am
doing with driver.

There is no sample code for this, but for gosh sakes, if you’re going to
dabble in driver programming, you at least have to be able to think for
yourself. Sit down in a quiet room with a piece of paper and THINK
about it. I’ve never done a disk driver, but I can certainly imagine
how to do this. Read requests come in for a specific sector number.
Right now, the RAM disk driver must be using that sector number as an
offset within its big buffer.

OK, so let’s say I allocate 4 big buffers of 64MB each. What has to
change? My read routine still gets a sector number, but now I have to
figure out WHICH of the 4 buffers that sector is in.

It’s not rocket science, and it’s probably not that much additional code.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi Calin,
According to “http://support.microsoft.com/kb/67321/” the size can go over 1GB.
I have done all your settings including regester. I set sector per cluster 64. Its working fine on size 990MB. But when I set the size 1GB or above its not working.

I test it on Vista 32 bits.Is there any explanation?

Thanks.

— On Thu, 1/22/09, Calin Iaru wrote:
From: Calin Iaru
Subject: RE: RE:[ntdev] RamDisk questions
To: “Windows System Software Devs Interest List”
Date: Thursday, January 22, 2009, 3:11 AM

The ramdisk can go over 64M by editing the settings as described in:
http://support.microsoft.com/kb/67321/

For instance, for a ramdisk between 256 and 511 MB, you have to specify

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Ramdisk\Parameters]
“DiskSize”=dword:18000000
“SectorsPerCluster”=dword:00000010

This works properly on Vista 32 where the memory limits for NP Pool are not
defined. In previous versions, the limit is 256 MB.
http://msdn.microsoft.com/en-us/library/aa366778(VS.85).aspx

You will also have to modify the sample by specifying the number of Huge
Sectors inside the RamDiskFormatDisk() function:
if( devExt->DiskRegInfo.DiskSize/devExt->DiskGeometry.BytesPerSector
< 65536 ) {
bootSector->bsSectors = (USHORT)(devExt->DiskRegInfo.DiskSize
/
devExt->DiskGeometry.BytesPerSector);
} else {
bootSector->bsSectors = 0;
bootSector->bsHugeSectors = devExt->DiskRegInfo.DiskSize /
devExt->DiskGeometry.BytesPerSector;
}
bootSector->bsMedia = (UCHAR)devExt->DiskGeometry.MediaType;

What does ‘not working’ mean exactly? Not > 1GB in size? BSOD? Other?

mm

Ashraf wrote:

Hi Calin,
According to “http://support.microsoft.com/kb/67321/” the size can go
over 1GB.
I have done all your settings including regester. I set sector per
cluster 64. Its working fine on size 990MB. But when I set the size 1GB
or above its not working.

I test it on Vista 32 bits.Is there any explanation?

Thanks.

— On *Thu, 1/22/09, Calin Iaru //* wrote:
>
> From: Calin Iaru
> Subject: RE: RE:[ntdev] RamDisk questions
> To: “Windows System Software Devs Interest List”
> Date: Thursday, January 22, 2009, 3:11 AM
>
> The ramdisk can go over 64M by editing the settings as described
> in:
> http://support.microsoft.com/kb/67321/
>
> For instance, for a ramdisk between 256 and 511 MB, you have to specify
> "
> Windows Registry Editor Version 5.00
> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Ramdisk\Parameters]
> “DiskSize”=dword:18000000
> “SectorsPerCluster”=dword:00000010
> "
> This works properly on Vista 32 where the memory limits for NP Pool are not
> defined. In previous versions, the limit is 256 MB.
> http://msdn.microsoft.com/en-us/library/aa366778(VS.85).aspx
>
> You will also have to modify the sample by specifying the number of Huge
> Sectors inside the RamDiskFormatDisk() function:
> if( devExt->DiskRegInfo.DiskSize/devExt->DiskGeometry.BytesPerSector
> < 65536 ) {
> bootSector->bsSectors = (USHORT)(devExt->DiskRegInfo.DiskSize
> /
> devExt->DiskGeometry.BytesPerSector);
> } else {
>
> bootSector->bsSectors = 0;
> bootSector->bsHugeSectors = devExt->DiskRegInfo.DiskSize /
> devExt->DiskGeometry.BytesPerSector;
> }
> bootSector->bsMedia = (UCHAR)devExt->DiskGeometry.MediaType;
>
>

Its shown nothing. That means no driver has been created.
I forgot to mention here that my systems has 4GB of RAM.

Thanks.

— On Mon, 1/26/09, Martin O’Brien wrote:
From: Martin O’Brien
Subject: Re:[ntdev] RamDisk questions
To: “Windows System Software Devs Interest List”
Date: Monday, January 26, 2009, 2:19 AM

What does ‘not working’ mean exactly? Not > 1GB in size? BSOD?
Other?

mm

Ashraf wrote:
> Hi Calin,
> According to “http://support.microsoft.com/kb/67321/” the size
can go over 1GB.
> I have done all your settings including regester. I set sector per cluster
64. Its working fine on size 990MB. But when I set the size 1GB or above its not
working.
>
> I test it on Vista 32 bits.Is there any explanation?
>
> Thanks.
>
> — On Thu, 1/22/09, Calin Iaru // wrote:
>
> From: Calin Iaru
> Subject: RE: RE:[ntdev] RamDisk questions
> To: “Windows System Software Devs Interest List”

> Date: Thursday, January 22, 2009, 3:11 AM
>
> The ramdisk can go over 64M by editing the settings as described
> in:
> http://support.microsoft.com/kb/67321/
>
> For instance, for a ramdisk between 256 and 511 MB, you have to
specify "
> Windows Registry Editor Version 5.00
>
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Ramdisk\Parameters]
> “DiskSize”=dword:18000000
> “SectorsPerCluster”=dword:00000010
> "
> This works properly on Vista 32 where the memory limits for NP Pool
are not
> defined. In previous versions, the limit is 256 MB.
> http://msdn.microsoft.com/en-us/library/aa366778(VS.85).aspx
>
> You will also have to modify the sample by specifying the number of
Huge
> Sectors inside the RamDiskFormatDisk() function:
> if(
devExt->DiskRegInfo.DiskSize/devExt->DiskGeometry.BytesPerSector
> < 65536 ) {
> bootSector->bsSectors =
(USHORT)(devExt->DiskRegInfo.DiskSize
> /
>
devExt->DiskGeometry.BytesPerSector);
> } else {
> bootSector->bsSectors = 0;
> bootSector->bsHugeSectors = devExt->DiskRegInfo.DiskSize
/
devExt->DiskGeometry.BytesPerSector;
> }
> bootSector->bsMedia =
(UCHAR)devExt->DiskGeometry.MediaType;
>
>


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer