Archive: structure System::Call problem?!


structure System::Call problem?!
Hello,

I have a problem with this piece of code, it seems to show no function

# allocate a buffer and put 'test string' and an int in it
System::Call "*(i 3, &t1024 'test driver', &t1024 'Windows NT x86', &t1024 'mydll.DLL', &t1024 'mydef.PPD', &t1024 'myUI.DLL', &t1024 'myhelp.HLP', &t1024 'somentf.NTF\0another.NTF\0\0') i .s"
Pop $0
# get string and int in $1 buffer
System::Call "*$0(i .r2, &t1024 .r3, &t1024 .r4,&t1024 .r5,&t1024 .r6,&t1024 .r7,&t1024 .r8,&t1024 .r9)"

System::Call 'winspool.drv::AddPrinterDriver(NULL, 2, $0) i .r10'

System::Free $0


I passover the structure in $0 to AddPrinterDriver, allthough it does not work. I can view the data in $2, so it seems everything is there. Does someone have an idea what is wrong in this code?

thanks a lot, I am really stuck.

hans


DRIVER_INFO_3 structure defines 9 text fields, you allocates 7 only, is this OK?


hi,
I've added the two missing ones (which are empty, therefor I thought I can leave them away) and it still does not work... :(


May be

System::Call 'winspool.drv::AddPrinterDriver(i 0, i 2, i r0) i .r10'

DRIVER_INFO_3 has pointers to strings, you have the strings themselves in your structure. You must allocate buffers for strings and put pointers to them in a DRIVER_INFO_3 structure.