Click here to Skip to main content
15,912,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DllRegister Server Error 0x8007007e Pin
Schehaider_Aymen2-Jun-10 3:29
Schehaider_Aymen2-Jun-10 3:29 
GeneralRe: DllRegister Server Error 0x8007007e Pin
KarstenK2-Jun-10 3:34
mveKarstenK2-Jun-10 3:34 
GeneralRe: DllRegister Server Error 0x8007007e Pin
Schehaider_Aymen2-Jun-10 4:24
Schehaider_Aymen2-Jun-10 4:24 
GeneralRe: DllRegister Server Error 0x8007007e Pin
KarstenK2-Jun-10 4:33
mveKarstenK2-Jun-10 4:33 
GeneralRe: DllRegister Server Error 0x8007007e Pin
Code-o-mat2-Jun-10 4:30
Code-o-mat2-Jun-10 4:30 
GeneralRe: DllRegister Server Error 0x8007007e Pin
Schehaider_Aymen2-Jun-10 5:01
Schehaider_Aymen2-Jun-10 5:01 
AnswerRe: DllRegister Server Error 0x8007007e Pin
Schehaider_Aymen2-Jun-10 5:31
Schehaider_Aymen2-Jun-10 5:31 
Questionwin32 service crashing in vista Pin
Subrat Patnaik2-Jun-10 0:01
Subrat Patnaik2-Jun-10 0:01 
hi,
i am having a service running in vista. it captures the information of the USB devices that are being used in the system.
i am registering for device notification when starting the service using the RegisterDeviceNotification API, however the service is crashing when i am calling UnregisterDeviceNotification API

Pasting the piece of code below....if needed i would also give the values out of debugging.
please could i get some help or hints as to why my service is crashing when i am calling UnregisterDeviceNotification ?

DWORD WINAPI service_ctrl(DWORD dwCtrlCode,DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext) 
{
	PDEV_BROADCAST_HDR  head = (PDEV_BROADCAST_HDR )lpEventData;

	switch (dwCtrlCode) 
	{
	case SERVICE_CONTROL_DEVICEEVENT: 
		if (dwEventType == DBT_DEVICEQUERYREMOVE)
		{
			if(head->dbch_devicetype == DBT_DEVTYP_HANDLE)
			{	
				PDEV_BROADCAST_HANDLE  db = (PDEV_BROADCAST_HANDLE) head;
				DebugLog("Remove Query");


				ht_pIter = handleThread.find(db->dbch_handle);
				if ( ht_pIter == handleThread.end( ) )
					DebugLog("cannot find Thread ID using Handle Value ");
				else
				{

					killThreadFunc(ht_pIter->second.threadHandle,ht_pIter->second.threadID);
					DebugLog("after killThreadFunc");
					if(!CloseHandle(db->dbch_handle))
					{

						DebugLog("Problem in Closing Directory Handle.");
					}

					char error[50] = {0};
					if(!UnregisterDeviceNotification(*ht_pIter->second.devNotify))
					{
						DebugLog("Problem in Unregistering Device notification.");
						sprintf(error,"Error Code returned is %d",GetLastError());
						DebugLog(error);					

					}

					handleThread.erase(db->dbch_handle);

					//SetEvent(hLogTrigger);
					DebugLog("Thread Terminate Successful");
				}

			}
			return NO_ERROR;
		}//end if DEVICEQUERYREMOVE
		break;
	}
}

AnswerRe: win32 service crashing in vista Pin
Aescleal2-Jun-10 0:41
Aescleal2-Jun-10 0:41 
QuestionVS2010 - debug version compiles, release version does not PinPopular
Ed SHaw1-Jun-10 22:38
Ed SHaw1-Jun-10 22:38 
AnswerRe: VS2010 - debug version compiles, release version does not Pin
KarstenK2-Jun-10 0:23
mveKarstenK2-Jun-10 0:23 
GeneralRe: VS2010 - debug version compiles, release version does not Pin
wishmaster802-Jun-10 2:20
wishmaster802-Jun-10 2:20 
GeneralRe: VS2010 - debug version compiles, release version does not Pin
KarstenK2-Jun-10 2:36
mveKarstenK2-Jun-10 2:36 
AnswerRe: VS2010 - debug version compiles, release version does not Pin
Ed SHaw2-Jun-10 10:56
Ed SHaw2-Jun-10 10:56 
GeneralRe: VS2010 - debug version compiles, release version does not PinPopular
mumg27-Jun-10 3:29
mumg27-Jun-10 3:29 
GeneralRe: VS2010 - debug version compiles, release version does not Pin
MatrixDud29-Apr-11 9:52
MatrixDud29-Apr-11 9:52 
AnswerRe: VS2010 - debug version compiles, release version does not Pin
GSc_Dev2-Nov-11 2:47
GSc_Dev2-Nov-11 2:47 
QuestionHow to differentiate a floppy drive and a USB drive in VC++? Pin
code6631-Jun-10 21:44
code6631-Jun-10 21:44 
AnswerRe: How to differentiate a floppy drive and a USB drive in VC++? Pin
Nuri Ismail1-Jun-10 22:18
Nuri Ismail1-Jun-10 22:18 
GeneralRe: How to differentiate a floppy drive and a USB drive in VC++? Pin
Subrat Patnaik2-Jun-10 0:04
Subrat Patnaik2-Jun-10 0:04 
AnswerRe: How to differentiate a floppy drive and a USB drive in VC++? [modified] Pin
Jackson20102-Jun-10 4:40
Jackson20102-Jun-10 4:40 
Questionmove function in maze does not work correctly Pin
hasani20071-Jun-10 21:40
hasani20071-Jun-10 21:40 
AnswerRe: move function in maze does not work correctly Pin
Nilesh Hamane1-Jun-10 22:17
Nilesh Hamane1-Jun-10 22:17 
AnswerRe: move function in maze does not work correctly Pin
chandu0042-Jun-10 0:00
chandu0042-Jun-10 0:00 
QuestionRe: move function in maze does not work correctly Pin
David Crow2-Jun-10 2:57
David Crow2-Jun-10 2:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.