From: Metroickha on 12 Mar 2010 05:07 Hello all, I have a question about exporting functions in a driver. I did some exporting functions in other projects by using __declspec(dllexport) but using that in a printer driver it fails to build. I used data_seg(shared) to share data between processes using this DLL. How ever I want to retrieve this data. I still haven't figured out how to do this. I thought using properties (get /set) would make it possible. Could anyone help me ^^?
From: Maxim S. Shatskih on 12 Mar 2010 06:02 > __declspec(dllexport) This is a dirty toy unsuitable for real projects, since it exports the functions with mangled names. Use the proper way, i.e. .DEF file. > I used data_seg(shared) to share data between processes using this DLL. Amazingly bad solution. Can you use some sort of interprocess communication instead? why do you need this global data in a printer driver anyway? -- Maxim S. Shatskih Windows DDK MVP maxim(a)storagecraft.com http://www.storagecraft.com
From: Metroickha on 12 Mar 2010 07:36 Thanks for your reply. For an internship project I need to hook functions from the WIN32 GDI. I used an existing sample MSPlot, which has the functionalities I need. I need to hook for example CDC.LineTo() function using DrvLineTo() which stores all parameters to shared memory block. Example in my application CDC dc; dc.createDC("HP", "Plottername etc...", 0, 0); dc.MoveTo(0,0); dc.LineTo(10, 10); The driver catches LineTo(...) and stores it in the memory For example LineTo 10 10 From one other application we want to enter this shared memory block to retrieve the instructions. I need to build this driver for a realtime system. Storing in a bin file would be too slow. The used tenchiques might be bad, but this is how my stakeholder wants me to do it. If it's possible to make some systemwide variabele would be even more awesome ^^. "Maxim S. Shatskih" wrote: > > __declspec(dllexport) > > This is a dirty toy unsuitable for real projects, since it exports the functions with mangled names. > > Use the proper way, i.e. .DEF file. > > > I used data_seg(shared) to share data between processes using this DLL. > > Amazingly bad solution. Can you use some sort of interprocess communication instead? why do you need this global data in a printer driver anyway? > > -- > Maxim S. Shatskih > Windows DDK MVP > maxim(a)storagecraft.com > http://www.storagecraft.com > > . >
From: Alexander Grigoriev on 12 Mar 2010 09:39 Also, the global data is logon session-local. "Maxim S. Shatskih" <maxim(a)storagecraft.com.no.spam> wrote in message news:%23q5VDOdwKHA.4492(a)TK2MSFTNGP05.phx.gbl... > __declspec(dllexport) This is a dirty toy unsuitable for real projects, since it exports the functions with mangled names. Use the proper way, i.e. .DEF file. > I used data_seg(shared) to share data between processes using this DLL. Amazingly bad solution. Can you use some sort of interprocess communication instead? why do you need this global data in a printer driver anyway? -- Maxim S. Shatskih Windows DDK MVP maxim(a)storagecraft.com http://www.storagecraft.com
From: Eugene Mayevski on 12 Mar 2010 16:06 > The used tenchiques might be bad, but this is how my stakeholder wants me > to > do it. > If it's possible to make some systemwide variabele would be even more > awesome ^^. This is done using memory-mapped files. Quickly and efficiently. read about CreateFileMapping / MapViewOfFile WinAPI functions. Note, that you will also need to dig deeper into description of SecurityAttributes parameter of CreateFileMapping. The reason is that default value (passing NULL) will have certain limitations in Vista and Windows 7. You will need to create special kind of attributes record with "Allow full access for everyone" set. -- With best regards, Eugene Mayevski http://www.eldos.com/ - security and virtual storage components
|
Pages: 1 Prev: WHQL Test For Filter Driver Next: DIFxAPI for 32 and 64 bit OS |