Hi All,
I have a problem. I have a test application. Which gathers some system information writes into file , goes in suspend mode , again gets system information writes it
in INI file using WritePrivateProfileString() API.
This all process is done in a long loop like 1400 or so.
Time taken by WritePrivateProfileString() API is around 2 millisec in first loop but it increases upto 150 millisec in the last loops.
I suspect that there may be memory leaks. Due to which WritePrivateProfileString() API takes more time as it has to Open the ini file , write info and again close it.
If memory leaks occur, virtual memory will become less and it will take more time to do memory management to take the file in memory and write info and so on.
Could i be correct or there is any flaw. Has someone encountered this kind of problem with WritePrivateProfileString().
If yes or if anybody has some idea then please share.
Thanks a lot
Regards
Prashant
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]On Behalf Of Alexei Jelvis
Sent: Tuesday, October 14, 2003 7:09 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Re: Problem manually creating IRP to submit from one driver to another
If you build an IRP using IoAllocateIrp you MUST set a completion routine that returns STATUS_MORE_PROCESSING_REQUIRED to avoid processing the IRP completion by IoManager. It is the respnsobility of the driver that allocated the IRP to free it if you don’t want to reuse the IRP. Usually IoFreeIrp is called from the completion routine.
Alexei.
“David West” < David.West@cs.tcd.ie> wrote in message news:xxxxx@ntdev…
Hi,
I’m trying to send a simple IOCTL to a driver from another driver, by manually creating an IRP and submitting it (Is there another way to do this from within a driver?). Unfortunately I am getting a BugCheck 7E, (exception c0000005, indicating a memory access violation), when the driver that is being called calls the IoComplete request function.
When I test sending the IOCTL with a user mode application, using the DeviceIoControl function, it executes without any problems.
This is the code I am using, is there any obvious problems/ommisions? Am I forgetting to initialise some part of the IRP or something? I’ve been stuck on this for ages, please help!
ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL);
status = IoGetDeviceObjectPointer(
&usDeviceName,
FILE_READ_DATA,
&m_pMyFileObject,
&m_pMyDeviceObject
);
if(!NT_SUCCESS(status)){
return STATUS_ERROR;
}
pIrp = IoAllocateIrp(m_pMyDeviceObject->StackSize, FALSE);
if(pIrp == NULL){
return STATUS_INSUFFICIENT_RESOURCES;
}
{
PIO_STACK_LOCATION _IRPSP;
pIrp->AssociatedIrp.SystemBuffer = pBuffer;
IoSetCompletionRoutine(pIrp, NULL, NULL, FALSE, FALSE, FALSE);
_IRPSP = IoGetNextIrpStackLocation(pIrp);
_IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;
_IRPSP->MinorFunction = 0;
_IRPSP->DeviceObject = m_pMyDeviceObject;
_IRPSP->FileObject = m_pMyFileObject;
_IRPSP->Parameters.DeviceIoControl.IoControlCode = IOCTL_DO_SOMETHING;
_IRPSP->Parameters.DeviceIoControl.InputBufferLength = sizeof(BUFFER_TYPE);
_IRPSP->Parameters.DeviceIoControl.OutputBufferLength = 0;
_IRPSP->Parameters.DeviceIoControl.Type3InputBuffer = 0;
}
//Go ahead and submit the request
status = IoCallDriver(m_pMyDeviceObject, pIrp);
Thanks,
David
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@zensar.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
This e-mail message (including its attachments) is private communication solely intended for the recipients named in it and may contain material which is confidential and privileged. No one other than the named recipients may read, copy, rely on, redirect, save, alter or otherwise make any use of the message or any part of it or any attachment to it in any way. If received by error, please advise the sender and then delete the mail from your system. Zensar Technologies Limited does not control the content of the emails and as such does not verify the correctness, accuracy or validity of the message. Any views or opinions presented are solely those of the author and do not represent those of Zensar Technologies Limited unless otherwise specifically stated. While reasonable effort has been made to ensure this message is free of viruses,interceptions or interference, opening and using this message is entirely at the risk of the recipient.