|
I am familiar with win32 app development, c, masm, and some kernel knowledge(mainly from the book "programming applications for ms windows" by Jeffrey Richtie).
Who could give me some suggestions? Thanks a lot.
|
|
|
|
|
Finding a good single resource for learning drivers is very tough. It can be a complex subject, and requires a lot more knowledge of how the OS works than app level programming.
Here's the usual list that is given on other forums when the question arises.
The WDK itself - documentation andthe samples are improving but it assumes you already have a good knowledge of the OS
"Programming the Windows Driver Model" 2nd ed by Walter Oney - make sure it is the 2nd edition
"Microsoft Windows Internals, Fourth Edition: Microsoft Windows
Server(TM) 2003, Windows XP, and Windows 2000" by Mark Russinovich and David Solomon
"Windows NT Device Driver Development" by Peter Viscarola and Tony Mason - dated but the stuff they discuss hasn't changed and it's a good foundation.
"Developing Drivers with the Windows® Driver Foundation" by Penny Orwick and Guy Smith - this one is from Microsoft Press and is the only book currently published with a good description of KMDF
This one should be excellent (if they ever get it published) "Introduction to the Windows Driver Foundation Kernel Mode Driver Framework " by Peter Viscarola, Tony Mason, Mark Cariddi, Brenda Ryan, Scott Noone, and OSR
Judy
|
|
|
|
|
See here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Dear All,
I have three MFC Exes.My Installer runs all three exes as soon as I install my application.It works fine.I made entries in registry so that after rebooting My exes will automatically run.
But some times I faced very unusual problem,
I installed my application then rebooted my system After rebooting my all MFC exes of my application get deleted from my hard disk.
Please help me for solving this issue.
Rahul Vaishnav
|
|
|
|
|
Rahul Vaishnav wrote: Please help me for solving this issue.
Viruses!, because Windows didn't delete anything,till it instructed too.. you can also check Installer, might be somebody have play a prank on you.. MoveFileEx is famouse for playing prank with people. as it delete the file at reboot, if you use proper flags!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hello,
I have a question about callback function.
My code is waveInOpen(&hWav,0, &wfx,WaveInCallback ,0, CALLBACK_FUNCTION);
But it comes some problems, the error message is
error C3867: 'p2p::Form1::WaveInCallback': function call missing argument list; use '&p2p::Form1::WaveInCallback' to create a pointer to member
I dont realize what happened.
Can anybody solve this question for me?
Jane
|
|
|
|
|
This error happens when you tried to take the address of a member function without qualifying the member function with its class name and the address-of operator.
Can you show the callback function declaration?
- NS -
|
|
|
|
|
OK.
void CALLBACK WaveInCallback(HWAVEIN hw, UINT uMsg,
DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD dwParam2)
{
waveInAddBuffer(hw, (WAVEHDR*)dwParam1, sizeof(WAVEHDR));
}
I create it in the From.h.
But I don't know where to allocate it.
|
|
|
|
|
Isn't it a static function? AFAIK it should be static function.
Also I found a mismatch with the documentation in MSDN. See...
void CALLBACK waveInProc(
HWAVEIN hwi,
UINT uMsg,
DWORD dwInstance,
DWORD dwParam1,
DWORD dwParam2
);
You are using DWORD_PTR instead of DWORD. But I am not sure about this
- NS -
|
|
|
|
|
Appreciate for ur reply.
But it's still same.
|
|
|
|
|
Try to cast like
waveInOpen(&hWav,0, &wfx,(DWORD_PTR)WaveInCallback ,0, CALLBACK_FUNCTION);
- NS -
|
|
|
|
|
It comes other errors.@@
1.error C3374: can't take address of 'p2p::Form1::WaveInCallback' unless creating delegate instance
2.error C2440: 'type cast' : cannot convert from 'void (__clrcall p2p::Form1::* )(HWAVEIN,UINT,DWORD_PTR,DWORD_PTR,DWORD)' to 'DWORD_PTR'
|
|
|
|
|
Please show me the declaration of the callback function. Not in the cpp but inside the class in header file.
- NS -
|
|
|
|
|
NS17 wrote: Please show me the declaration of the callback function.
It's declared in mmsystem.h :
void CALLBACK waveInProc(
HWAVEIN hwi,
UINT uMsg,
DWORD dwInstance,
DWORD dwParam1,
DWORD dwParam2
);
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: It's declared in mmsystem.h:
I meant how he declared the the function to use as callback.
- NS -
|
|
|
|
|
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
int call_id;
void CALLBACK WaveInCallback(HWAVEIN hw, UINT uMsg,DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD dwParam2)
{
WAVEHDR* curhdr = (WAVEHDR*)dwParam1;
waveInAddBuffer(hw, curhdr, sizeof(WAVEHDR));
}
............
I put in the class form1
|
|
|
|
|
minihotto wrote: public ref class Form1 : public System::Windows::Forms::Form
You very certainly wanted to ask that in the "Managed C++"-Forum?!?
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
I agree ask on the correct forum.
|
|
|
|
|
I am not sure about this coding.
In C++, it should be static declaration. Try to make it static function.
- NS -
|
|
|
|
|
Hi All,,
I am using MFC Application with VS 2005.
In my application I am capturing the current screen by creating virtual window(by CreateWindow()) and apply hooks to that Window. In hooks I take the perticuler region which is going to be updated and convert it into the rectangle and send these messages to the my application. In My MFC class I store these all rectangles into the list.
And I retrived these list and capture from screen (using bitmap)with that perticular rectangle and compress that rectangle using JPEG.
Here I used Hooks as DLL in other project in my current workspace, so it gives me continues messages with that rectangles.
So , How can I set thread ( or Critical section or mutex) in my application and plz suggest me where i have to create Thread or on which method or class.
I am very sorry for very large description but it is good to understand.
Thanks in Advance.
Ashish Bhatt
|
|
|
|
|
Do you really have to use a thread? (Multitasking should be avoided at all costs, in my opinion)
|
|
|
|
|
ashishbhatt wrote: but it is good to understand.
Yes it is. Therefore it would be good for you to understand threads and threading issues before you develop a multi-threading application yes?
There are sources on the internet you can use, try google, I also recommend the book Advanced Windows by Richter.
|
|
|
|
|
Hi All,
I am writing a Win32 application to retrieve the information of all drivers on the user’s system. To do the same, following steps are used:-
1. SC_HANDLE hSCManager = OpenSCManager()
2. use the hSCManager to enumerate drivers using EnumServicesStatusExW( ) as follows
ENUM_SERVICE_STATUS_PROCESSW* pBuf ;
EnumServicesStatusExW( hSCManager, SC_ENUM_PROCESS_INFO, SERVICE_DRIVER, SERVICE_STATE_ALL, pBuf , dwBytesNeeded, &dwBytesNeeded, &dwTotalDrivers, &dwResumeHandle, NULL ) ;
3. I get service name using pServiceStatusProcess[i].lpServiceName
Now I need to retrieve further information of the driver for which I follow following steps
4. SC_HANDLE hService = OpenServiceW( hSCManager, wstrDriverName.c_str(), SC_MANAGER_ALL_ACCESS )
5. QueryServiceConfigW( hService, lpQueryServiceConfig, dwNeeded, &dwNeeded )
I get fully qualified path name of driver file name using lpQueryServiceConfig->lpBinaryPathName
My problem is, I am not able to get path name for all drivers. Dont know why? I am getting blank file name for following drivers
Abiosdsk, abp480n5, ACPIEC, adpu160m, Aha154x, aic78u2, aic78xx, AliIde, amsint, asc, asc3350p, asc3550, Atdisk, Beep, cbidf2k, cd20xrnt, Cdaudio, Cdfs, Changer, CmdIde
I need fully qualified filename of the driver to retrieve information like creation time, version information of the respective driver files.
Please let me know if there is any way to get the desired information.
Thanks in advance
Manish c
|
|
|
|
|
manish_c wrote: My problem is, I am not able to get path name for all drivers. Dont know why? I am getting blank file name for following drivers
Abiosdsk, abp480n5, ACPIEC, adpu160m, Aha154x, aic78u2, aic78xx, AliIde, amsint, asc, asc3350p, asc3550, Atdisk, Beep, cbidf2k, cd20xrnt, Cdaudio, Cdfs, Changer, CmdIde
Peeking into the registry reveals that those particular entries do not contain a path name. If it isn't there, the SCM can't give you one. It is working correctly and telling you that there isn't a binary name.
Judy
|
|
|
|
|
My problem is this:
I use SetSel() and SendMessage(EM_SETCHARFORMAT, ...) to highlight stuff in the control, and it works fine when using SetWindowText() to set the contents of the control. However, when I use streaming for setting the contents, and if the selection to highlight starts at the first character position (CHARRANGE.cpMin = 0), the highlighting is applied to the entire contents of the control. Moreover, the formatting remains when I fill the control with new text, even if I don't highlight anything in the new text.
Reproducable with:
<br />
int nTransfer;<br />
<br />
nTransfer = _tcslen(m_pchStreamBuf);<br />
if(nTransfer > cb)<br />
nTransfer = cb;<br />
memmove(pbBuff, m_pchStreamBuf, nTransfer);<br />
*pcb = nTransfer;<br />
m_pchStreamBuf += nTransfer;<br />
return 0;<br />
<br />
CHARFORMAT2 cf;<br />
memset(&cf, 0, sizeof(cf));<br />
cf.cbSize = sizeof(cf);<br />
cf.dwMask = CFM_COLOR | CFM_BACKCOLOR;<br />
cf.crTextColor = RGB(0x00, 0, 0);<br />
cf.crBackColor = RGB(0x00, 0xff, 0xff);<br />
m_ctrl.SetSel(0, 3);<br />
m_ctrl.SendMessage(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);<br />
Anyone?
|
|
|
|
|