none
Question of driver code RRS feed

  • Question

  • Hello,

    Is it appropriate to put in a driver variables of large size eg 'WCHAR filenamedebug [512] = {0};' ?
    If not, what can happen in the extreme case if the 'ProcessEndCreate' function is executed?
    If not, what can happen in the extreme case if the ProcessEndCreate 'function is never executed?

    For info I put this variable 'WCHAR filenamedebug [512] = {0};' temporarily to wine time developpment about for debugging with DebugView.


    Call by IRP_MJ_CREATE: 

    void ProcessEndCreate(PPARAMVDF vdf,PCOM2 cmd,PIRP irp,PIO_STACK_LOCATION irps,PFILE_OBJECT _bfile,PFILE_OBJECT _brelatedfile)
    {
    	WCHAR filenamedebug[512] = { 0 };
    NTSTATUS status;
    ...
    ...
    ...
    KDPrint(("ProcessEndCreate '%ws'  CCB: %.8x\n", filenamedebug,fsc));
    }

    Thank


    • Edited by Sizy458 Sunday, August 18, 2019 8:08 PM
    Sunday, August 18, 2019 8:08 PM

Answers

  • You only have a small stack for the kernel 12K on a 32-bit system and 24K on 64-bit systems.  So you are grabbing a lot of memory for this.  It really depends on the context you are calling the function in.   If you stack overflow in the kernel you crash the system.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Sunday, August 18, 2019 8:27 PM