home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dosapi.zip / DOSAPI.C next >
C/C++ Source or Header  |  1994-08-16  |  3KB  |  166 lines

  1. #include "dosapi.h"
  2.  
  3. unsigned int Dos32CreateEventSem( char far *Crt_Sem_Name,
  4.              unsigned long far *Crt_Sem_Handle, unsigned int Crt_Sem_Attr,
  5.              unsigned char Crt_Sem_State )
  6. {
  7.     unsigned return_code;
  8.  
  9.     asm {
  10.             mov ah, 0x64
  11.             mov bx, 0x0144
  12.             mov cx, 0x636C
  13.             push ds
  14.             mov dx, Crt_Sem_Attr
  15.             mov al, Crt_Sem_State
  16.             les di, Crt_Sem_Name
  17.             lds si, Crt_Sem_Handle
  18.             int 0x21
  19.             pop ds
  20.             mov return_code, ax
  21.         }
  22.  
  23.     return( return_code );
  24. }
  25.  
  26. unsigned int Dos32OpenEventSem( char far *Opn_Sem_Name,
  27.              unsigned long far *Opn_Sem_Handle )
  28. {
  29.     unsigned return_code;
  30.  
  31.     asm {
  32.             mov ah, 0x64
  33.             mov bx, 0x0145
  34.             mov cx, 0x636C
  35.             push ds
  36.             les di, Opn_Sem_Name
  37.             lds si, Opn_Sem_Handle
  38.             int 0x21
  39.             pop ds
  40.             mov return_code, ax
  41.         }
  42.  
  43.     return( return_code );
  44.  
  45. }
  46.  
  47. unsigned int Dos32CloseEventSem( unsigned long Cls_Sem_Handle )
  48. {
  49.     unsigned return_code;
  50.  
  51.     asm {
  52.             mov ah, 0x64
  53.             mov bx, 0x0146
  54.             mov cx, 0x636C
  55.             les si, Cls_Sem_Handle
  56.             push es
  57.             pop  dx
  58.             int 0x21
  59.             mov return_code, ax
  60.         }
  61.  
  62.     return( return_code );
  63.  
  64. }
  65.  
  66. unsigned int Dos32PostEventSem( unsigned long Pst_Sem_Handle )
  67. {
  68.     unsigned return_code;
  69.  
  70.     asm {
  71.             mov ah, 0x64
  72.             mov bx, 0x0148
  73.             mov cx, 0x636C
  74.             les si, Pst_Sem_Handle
  75.             push es
  76.             pop  dx
  77.             int 0x21
  78.             mov return_code, ax
  79.         }
  80.  
  81.     return( return_code );
  82. }
  83.  
  84. unsigned int Dos32ResetEventSem( unsigned long Rst_Sem_Handle,
  85.             unsigned int far *Rst_Sem_Count )
  86. {
  87.     unsigned return_code;
  88.  
  89.     asm {
  90.             mov ah, 0x64
  91.             mov bx, 0x0147
  92.             mov cx, 0x636C
  93.             les si, Rst_Sem_Handle
  94.             push es
  95.             pop  dx
  96.             les di, Rst_Sem_Count
  97.             int 0x21
  98.             mov return_code, ax
  99.         }
  100.  
  101.     return( return_code );
  102.  
  103.  
  104. }
  105.  
  106. unsigned int Dos32QueryEventSem( unsigned long Qry_Sem_Handle,
  107.             unsigned int far *Qry_Sem_Count )
  108. {
  109.     unsigned return_code;
  110.  
  111.     asm {
  112.             mov ah, 0x64
  113.             mov bx, 0x014A
  114.             mov cx, 0x636C
  115.             les si, Qry_Sem_Handle
  116.             push es
  117.             pop  dx
  118.             les di, Qry_Sem_Count
  119.             int 0x21
  120.             mov return_code, ax
  121.         }
  122.  
  123.     return( return_code );
  124.  
  125.  
  126. }
  127.  
  128. unsigned int Dos32WaitEventSem( unsigned long Wat_Sem_Handle,
  129.             unsigned char Wat_Sem_Seconds )
  130. {
  131.     unsigned return_code;
  132.  
  133.     asm {
  134.             mov ah, 0x64
  135.             mov bx, 0x0149
  136.             mov cx, 0x636C
  137.             les si, Wat_Sem_Handle
  138.             push es
  139.             pop  dx
  140.             mov al, Wat_Sem_Seconds
  141.             int 0x21
  142.             mov return_code, ax
  143.         }
  144.  
  145.     return( return_code );
  146. }
  147.  
  148. unsigned int DosStartSession( Session_Data *Sess_Pointer )
  149. {
  150.     unsigned return_code;
  151.  
  152.     asm {
  153.             mov ah, 0x64
  154.             mov bx, 0x0025
  155.             mov cx, 0x636C
  156.             push ds
  157.             lds si, Sess_Pointer
  158.             int 0x21
  159.             pop ds
  160.             mov return_code, ax
  161.         }
  162.  
  163.     return( return_code );
  164. }
  165.  
  166.