delorie.com/djgpp/doc/libc/libc_446.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

_go32_dpmi_set_protected_mode_interrupt_vector

Syntax

 
#include <dpmi.h>

int _go32_dpmi_set_protected_mode_interrupt_vector(
        int vector, _go32_dpmi_seginfo *info
);

Description

See section DPMI Overview.

This function sets the protected mode interrupt vector specified to point to the given function. The pm_offset and pm_selector fields of info must be filled in (see section _go32_my_cs). The following should be noted:

Return Value

Zero on success, nonzero on failure.

Portability

ANSI/ISO C No
POSIX No

Example

 
volatile int tics = 0;

timer_handler()
{
  tics++;
}

int main()
{
  _go32_dpmi_seginfo old_handler, new_handler;

  printf("grabbing timer interrupt\n");
  _go32_dpmi_get_protected_mode_interrupt_vector(8, &old_handler);
  
  new_handler.pm_offset = (int)tic_handler;
  new_handler.pm_selector = _go32_my_cs();
  _go32_dpmi_chain_protected_mode_interrupt_vector(8, &new_handler);

  getkey();

  printf("releasing timer interrupt\n");
  _go32_dpmi_set_protected_mode_interrupt_vector(8, &old_handler);

  return 0;
}


  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004