Click here to Skip to main content
15,908,775 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: encrypt and decrypt in UNICODE Pin
kiranin18-Jan-07 20:04
kiranin18-Jan-07 20:04 
GeneralRe: encrypt and decrypt in UNICODE Pin
Rajesh R Subramanian18-Jan-07 20:07
professionalRajesh R Subramanian18-Jan-07 20:07 
GeneralRe: encrypt and decrypt in UNICODE Pin
Mark Salsbery19-Jan-07 5:59
Mark Salsbery19-Jan-07 5:59 
GeneralRe: encrypt and decrypt in UNICODE Pin
Mark Salsbery19-Jan-07 6:06
Mark Salsbery19-Jan-07 6:06 
GeneralRe: encrypt and decrypt in UNICODE Pin
Mark Salsbery19-Jan-07 6:19
Mark Salsbery19-Jan-07 6:19 
QuestionUSB Drive Pin
radhika2818-Jan-07 17:57
radhika2818-Jan-07 17:57 
AnswerRe: USB Drive Pin
Michael Dunn18-Jan-07 19:47
sitebuilderMichael Dunn18-Jan-07 19:47 
Questioncmd.exe bug / GetFileType from kernel mode Pin
Mike_V18-Jan-07 16:20
Mike_V18-Jan-07 16:20 
Okay... this question feels out of place in this forum, but it doesn't fit in OS/SysAdmin as that is more of the usage side - not the programming side. Given my driver is in C++, I figure this is as good a place as any.

That out of the way, I found a bug (handle leak) in cmd.exe:

I'm writing a device driver that I want to be able to write stuff to via the command prompt redirection. For example, typing
echo Hello there > \\.\MyDevice

Should send the string "Hello there" to the MyDevice device.

Unfortunately it does not work. Cmd opens the handle to my device, but never writes to it or closes it! So until I exit cmd, my driver cannot be unloaded.

Some debugging indicates that cmd opens my device with CreateFile, which succeeds, then calls GetFileType, and since it is not a file or network file, it cancels the redirection operation, forgetting to close the original handle.

So now for the real question:

Does anybody happen to know how GetFileType is implemented in kernel mode (ie. if there's a field of the FILE_OBJECT I can set to get GetFileType to work properly? Or is there any way to register something like lpt1 which is a device that cmd can write to?

Thanks,
Mike
Questionhelp returning data from DLL Pin
Calvin Streeting18-Jan-07 13:36
Calvin Streeting18-Jan-07 13:36 
QuestionRe: help returning data from DLL Pin
prasad_som18-Jan-07 17:30
prasad_som18-Jan-07 17:30 
AnswerRe: help returning data from DLL Pin
Calvin Streeting18-Jan-07 22:00
Calvin Streeting18-Jan-07 22:00 
QuestionProblem with my code - cant fine what wrong - please need help. Pin
Yanshof18-Jan-07 12:12
Yanshof18-Jan-07 12:12 
AnswerRe: Problem with my code - cant fine what wrong - please need help. Pin
Stephen Hewitt18-Jan-07 12:17
Stephen Hewitt18-Jan-07 12:17 
GeneralRe: Problem with my code - cant fine what wrong - please need help. Pin
prasad_som18-Jan-07 17:33
prasad_som18-Jan-07 17:33 
GeneralRe: Problem with my code - cant fine what wrong - please need help. Pin
Yanshof18-Jan-07 21:03
Yanshof18-Jan-07 21:03 
QuestionRe: Problem with my code - cant fine what wrong - please need help. Pin
prasad_som18-Jan-07 21:26
prasad_som18-Jan-07 21:26 
AnswerRe: Problem with my code - cant fine what wrong - please need help. Pin
Yanshof18-Jan-07 21:26
Yanshof18-Jan-07 21:26 
GeneralRe: Problem with my code - cant fine what wrong - please need help. Pin
prasad_som18-Jan-07 21:44
prasad_som18-Jan-07 21:44 
GeneralRe: Problem with my code - cant fine what wrong - please need help. Pin
Yanshof18-Jan-07 21:56
Yanshof18-Jan-07 21:56 
GeneralRe: Problem with my code - cant fine what wrong - please need help. Pin
prasad_som18-Jan-07 22:00
prasad_som18-Jan-07 22:00 
QuestionHow can I pass a pointer to a VARIANT to a function? Pin
Joan M18-Jan-07 10:35
professionalJoan M18-Jan-07 10:35 
AnswerRe: How can I pass a pointer to a VARIANT to a function?[modified] Pin
CPallini18-Jan-07 11:03
mveCPallini18-Jan-07 11:03 
GeneralRe: How can I pass a pointer to a VARIANT to a function?[modified] Pin
Joan M18-Jan-07 19:47
professionalJoan M18-Jan-07 19:47 
GeneralRe: How can I pass a pointer to a VARIANT to a function?[modified] Pin
CPallini18-Jan-07 21:03
mveCPallini18-Jan-07 21:03 
AnswerRe: How can I pass a pointer to a VARIANT to a function? Pin
Stephen Hewitt18-Jan-07 12:12
Stephen Hewitt18-Jan-07 12:12 

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.