hi all, is there anyone have that? or maybe, could any code one with IOCTL stuff?
please example for msvc only, not for third party compiler ;)

btw, is IOCTL bidirectional or one directional ? from Icz tut, i know that it just comm from w32app to vxd, but not from vxd to w32app. other example showing shell_msg and other shell calls. but is there any other way instead using shell vxd to comm with w32app? i just want something that can pass data to editbox/whatever dlgcontrol in w32app, without msgbox.

thanks
Posted on 2002-12-15 02:12:12 by dion
Hi Dion

Not really sure but are you asking how you can transfer data from your own vxd to your Win32 app? If so, I think you may have asked that question a while back and I posted some example code of how to create a structure in the vxd, fill it with whatever variables and strings you want, then pass a pointer to the structure back to Win32 via the lpOutBuffer of a DeviceIoControl call. You can then reference each item in the structure and display it in an edit box or whatever. Alternatively, I think you could pass a pointer to a Win32 structure to the vxd via lpInBuffer and fill it up the same way. It all depends on personal preference and how you want to use your DeviceIoControl calls.

Cheers,
Kayaker
Posted on 2002-12-15 04:33:54 by Kayaker

Hi Dion

Not really sure but are you asking how you can transfer data from your own vxd to your Win32 app? If so, I think you may have asked that question a while back and I posted some example code of how to create a structure in the vxd, fill it with whatever variables and strings you want, then pass a pointer to the structure back to Win32 via the lpOutBuffer of a DeviceIoControl call. You can then reference each item in the structure and display it in an edit box or whatever. Alternatively, I think you could pass a pointer to a Win32 structure to the vxd via lpInBuffer and fill it up the same way. It all depends on personal preference and how you want to use your DeviceIoControl calls.
Cheers,
Kayaker


uhm... yes, that's too. but, i stress out the the c language.

actually i have had got the example. i attach the file below for anyone who need it .

the method used by the author to comm from vxd to win16app is using _SHELL_CallDll. so he make a dll with export function contain SendMessage API to send the msg to win16app. but... still i dont want this way. just doesnt make sense to make dll just to call sendmessage api.

anyone know better and more efficient way? or can we call export in w32app by calling _SHELL_LoadLibrary and _SHELL_GetProcAddress?

btw, anyone could post CVXD32 sample from the Windows 95 DDK? i dont have 95ddk :(

thanks
Posted on 2002-12-15 07:42:01 by dion
Looking at the DDK and Icz's AppyTime vxd tut 7, _SHELL_LoadLibrary and _SHELL_GetProcAddress might be the way to go depending on what API you want to call. These would be the 16 bit versions in Krnl386.exe / User.exe but several of them might work just as well as the 32 bit ones depending on what you want to do. If not, _SHELL_PostMessage in your vxd AppyTime callback function may work to directly communicate with your Win32 gui controls, i.e. posting WM_SETTEXT to an edit control which you've passed the hwnd of to the vxd?

The thing to do is just try it. Set up an Appytime skeleton a la Icz's tut and experiment with what you can put into the callback function. The other option you might want to look into, again depending on whatever it is you're trying to do, is the IFSMgr_Ring0_FileIO functions, you can then read everything you put into a file from disk later in Win32. Still think you could do most of what you need to do with DeviceIOControl though... Can't help with any C stuff.
Posted on 2002-12-15 14:14:23 by Kayaker
hi Kayaker, is it safe to access vxd_pageable area within win32app?

thanks
Posted on 2002-12-15 22:43:42 by dion
Shouldn't be a problem Dion, I've tried it both ways, having the variable structure to access from Win32 in a VxD_LOCKED_DATA_SEG or a VxD_PAGEABLE_DATA_SEG and there were no problems with either. Usually the only thing I keep in a locked data segment are the Exception_Handler_Struc <> declarations, but it's probably wise to keep anything you want to make sure isn't paged out to disk in there as well, without locking up too much system memory unnecessarily.

What you're passing back to Win32 is a pointer to the start of the named structure in the vxd, so you need to reference the fields in Win32 by their relative offset to this. Or you can do it in reverse, pass a pointer to a Win32 structure to the vxd and fill it by offset referencing the fields in the vxd. Then you can reference them by name in Win32 (never actually tried it this way though).
Posted on 2002-12-16 00:25:05 by Kayaker
hi all, i must sorry for being dumb. actually i just realized yesterday that all i look for is in src/base directory from w98ddk.

and now, i condemn myself with trying to write vxd in "full" c. well, with guide from src\base\cvxd32 and Icz vxdtut, i start my own vxd with 2 file named abc.c and abc.def. well, yes, abc.def is should be included in abc.c too , but sadly i dont have any idea how to do that. should someone know, please tell me ;)

i had succeed adapting Icz tut 3 example in C, but then i had problem in control_dispatch proc. i wrote :



__declspec( naked ) void ABC_Control()
{
if(eax==W32_DEVICEIOCONTROL) OnDeviceIoControl();
_asm clc;
_asm ret;
}


well, obviously compiling this code would generate an err about unknown "eax". so, this is the problem, i dont know how to refer to register eax in c directly . anyone know how to do it? or know better solution?

just another question:
is there anyway to reduce vxd size? icz's tut3 and my c vxd compiled size are about 5KB. maybe using rebase?

little note:
i notice 4 field diff in ddb, between vxd compiled by c and by masm. they are: SDK_Ver, MajorVer, MinorVer, and PrevDDB. i have had set the major & minor version with 1 and 0, but in fact its compiled become 4 and 0Ah. and PrevDDB in Icz compiled are non-zero, meanwhile in me 0. well, dont know which one is true. maybe someone could verify it?

thanks in advance
Posted on 2002-12-17 02:19:51 by dion
hi all, i'm being stuck cant loading dynamic vxd. i've try to rename my abc sample name to _ABC, but still cant loaded by createfile :( anyone could check what wrong with my code, please?

here i attach my code.
thanks
Posted on 2002-12-17 22:12:57 by dion
hi, i've tried to rename ABC to 8 char name _CSAMPLE. but, it still wont load. i had compiled name _csample.vxd and _CSAMPLE_DDB for ddb name and _CSAMPLE in ddb's name field. so, i really dont know what i'm doing wrong here. i've tried to using embedded int1 in control_proc, but my debugger dont stop in that point. then i try using filemon to see if my vxd was read. yes, it is read by vxdloader. now, i really felt dumb and dont have any idea what is really happen. could anyone kindly tell me what wrong with my code and maybe could give me a way how to nail down the problem?

thanks
Posted on 2002-12-19 00:08:54 by dion