Click here to Skip to main content
15,903,012 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
SuggestionRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Charles Oppermann26-Jul-12 6:04
Charles Oppermann26-Jul-12 6:04 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Andraw11126-Jul-12 6:56
Andraw11126-Jul-12 6:56 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Andraw11126-Jul-12 5:54
Andraw11126-Jul-12 5:54 
SuggestionRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Charles Oppermann25-Jul-12 6:59
Charles Oppermann25-Jul-12 6:59 
QuestionHow to test firewire communication using C program ? Pin
Code_Demon_198524-Jul-12 4:58
Code_Demon_198524-Jul-12 4:58 
GeneralRe: How to test firewire communication using C program ? Pin
CPallini24-Jul-12 6:35
mveCPallini24-Jul-12 6:35 
QuestionHow to Undo drawing a line in MFC.? Pin
mbatra3124-Jul-12 1:02
mbatra3124-Jul-12 1:02 
AnswerRe: How to Undo drawing a line in MFC.? Pin
Eugen Podsypalnikov24-Jul-12 3:14
Eugen Podsypalnikov24-Jul-12 3:14 
AnswerRe: How to Undo drawing a line in MFC.? Pin
Alan Balkany24-Jul-12 4:02
Alan Balkany24-Jul-12 4:02 
GeneralSDI application with 3 views [SOLVED] Pin
ekinnh23-Jul-12 22:23
ekinnh23-Jul-12 22:23 
GeneralRe: SDI application with 3 views Pin
Eugen Podsypalnikov24-Jul-12 0:06
Eugen Podsypalnikov24-Jul-12 0:06 
GeneralRe: SDI application with 3 views Pin
Eugen Podsypalnikov24-Jul-12 0:17
Eugen Podsypalnikov24-Jul-12 0:17 
GeneralRe: SDI application with 3 views Pin
Mohibur Rashid25-Jul-12 14:45
professionalMohibur Rashid25-Jul-12 14:45 
GeneralRe: SDI application with 3 views Pin
Vaclav_25-Jul-12 16:51
Vaclav_25-Jul-12 16:51 
GeneralRe: SDI application with 3 views Pin
ekinnh26-Jul-12 18:13
ekinnh26-Jul-12 18:13 
GeneralRe: SDI application with 3 views Pin
Vaclav_27-Jul-12 2:42
Vaclav_27-Jul-12 2:42 
GeneralRe: SDI application with 3 views Pin
ekinnh31-Jul-12 22:13
ekinnh31-Jul-12 22:13 
GeneralRe: SDI application with 3 views Pin
Sunil P V26-Jul-12 2:09
Sunil P V26-Jul-12 2:09 
Question[Hook HW interrupts in flat mode with DOS32/A] Pin
liaoo23-Jul-12 16:42
liaoo23-Jul-12 16:42 
AnswerRe: [Hook HW interrupts in flat mode with DOS32/A] Pin
enhzflep23-Jul-12 19:01
enhzflep23-Jul-12 19:01 
Wow - there's a blast from the past.

With your sample app that hooks INT 0x1C, was that also running in flat-mode?

That is to say - the 80x86 family run in two modes - one that has a flat address-space and the other that has segmented memory space.

When in segmented mode (DOS) there's a table that holds the address of all of the ISRs. To hook an interrupt, you simply grab the table entry you want then overwrite it with the address of your own routine. Inside your routine you do what you need, calling the original routine before, after your code or not at all. When you want to remove the hook, you simply re-write the table entry.

While in protected mode (win,linux,dos4gw/dos32a) memory is arranged quite differently. You don't have a globally accessable place that you can just read and write in quite the same way. You have the beasts known as Interrupt Descriptor Table.

I spent a long time 15 years ago trying to roll-my-own code that would enter protected mode. I've got vague memories of having trouble wrapping my head around the IDT & GDT.


What I'm getting at, is that I can't be sure that the functions you're calling are intended for flat-mode. If the ISR is running in flat-mode, you can't even address it in the 4 bytes that each entry has in a real-mode IDT.
I also don't quite follow the formula you've used to come up with int 0x76

Anyway, here's a page on IDTs and the differences between real/protected mode.
http://en.wikipedia.org/wiki/Interrupt_descriptor_table[^]

You know what I'd probably be doing? Downloading the source-code for some old games that used the dos4g/w extended and looking there for some hints. You should find something in either the timing or the sound code. The one that immediately comes to mind is Doom. Don't remember if Duke Nukem 3d was too I beleive Rise Of The Triad - ROTT used the watcom compiler. A lot of games by iD, Apogee & 3dRealms of the era used the extender.

Good luck & thanks for the read & memories.Thumbs Up | :thumbsup:
GeneralRe: [Hook HW interrupts in flat mode with DOS32/A] Pin
liaoo23-Jul-12 19:47
liaoo23-Jul-12 19:47 
GeneralRe: [Hook HW interrupts in flat mode with DOS32/A] Pin
enhzflep23-Jul-12 20:23
enhzflep23-Jul-12 20:23 
GeneralRe: [Hook HW interrupts in flat mode with DOS32/A] Pin
liaoo23-Jul-12 22:02
liaoo23-Jul-12 22:02 
AnswerRe: [Hook HW interrupts in flat mode with DOS32/A] Pin
Software_Developer23-Jul-12 20:10
Software_Developer23-Jul-12 20:10 
GeneralRe: [Hook HW interrupts in flat mode with DOS32/A] Pin
liaoo23-Jul-12 22:05
liaoo23-Jul-12 22:05 

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.