Ignore:
Timestamp:
May 24, 2004, 10:56:07 AM (21 years ago)
Author:
sandervl
Message:

KOM: Updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/oslibmisc.cpp

    r9890 r10606  
    1 /* $Id: oslibmisc.cpp,v 1.18 2003-03-03 16:38:20 sandervl Exp $ */
     1/* $Id: oslibmisc.cpp,v 1.19 2004-05-24 08:56:07 sandervl Exp $ */
    22/*
    33 * Misc OS/2 util. procedures
     
    1717#define INCL_DOSSEL
    1818#define INCL_DOSNLS        /* National Language Support values */
    19 #include <os2wrap.h>    //Odin32 OS/2 api wrappers
     19#include <os2wrap.h>    //Odin32 OS/2 api wrappers
    2020#include <string.h>
    2121#include <stdlib.h>
     
    2424#include "oslibmisc.h"
    2525#include <misc.h>
    26 
    27 #define DBG_LOCALLOG    DBG_oslibmisc
     26#include <heapstring.h>
     27
     28#define DBG_LOCALLOG    DBG_oslibmisc
    2829#include "dbglocal.h"
    2930
     31typedef APIRET ( APIENTRY *PFN_IMSETMSGQUEUEPROPERTY )( HMQ, ULONG );
     32
     33PFN_IMSETMSGQUEUEPROPERTY pfnImSetMsgQueueProperty = NULL;
     34
    3035//******************************************************************************
    3136//TODO: not reentrant!
     
    3641
    3742  if(DosQueryModuleName(hModule, CCHMAXPATH, modname) != 0) {
    38         return NULL;
     43    return NULL;
    3944  }
    4045  return(modname);
     
    187192   rc = DosGetInfoBlocks(&ptib, &ppib);
    188193   if(rc) {
    189         return 0;
     194    return 0;
    190195   }
    191196   switch(tiboff)
    192197   {
    193         case TIB_STACKTOP:
    194                 return (ULONG)ptib->tib_pstacklimit;
    195         case TIB_STACKLOW:
    196                 return (ULONG)ptib->tib_pstack;
    197         default:
    198                 return 0;
     198    case TIB_STACKTOP:
     199        return (ULONG)ptib->tib_pstacklimit;
     200    case TIB_STACKLOW:
     201        return (ULONG)ptib->tib_pstack;
     202    default:
     203        return 0;
    199204   }
    200205}
     
    217222    if (rc)
    218223    {
    219             dprintf(("KERNEL32: OSLibGetPIB(%d): DosGetInfoBlocks failed with rc=%d\n", iPIB, rc));
     224        dprintf(("KERNEL32: OSLibGetPIB(%d): DosGetInfoBlocks failed with rc=%d\n", iPIB, rc));
    220225        return 0;
    221226    }
     
    248253   rc = DosAllocThreadLocalMemory(nrdwords, &thrdaddr);
    249254   if(rc) {
    250         dprintf(("DosAllocThreadLocalMemory failed %d", rc));
    251         return 0;
     255    dprintf(("DosAllocThreadLocalMemory failed %d", rc));
     256    return 0;
    252257   }
    253258   return (ULONG)thrdaddr;
     
    335340BOOL OSLibDisablePopups()
    336341{
    337    return DosError(FERR_DISABLEEXCEPTION | FERR_DISABLEHARDERR) == NO_ERROR;   
    338 }
    339 //******************************************************************************
    340 //******************************************************************************
     342   return DosError(FERR_DISABLEEXCEPTION | FERR_DISABLEHARDERR) == NO_ERROR;
     343}
     344//******************************************************************************
     345//******************************************************************************
     346ULONG OSLibImSetMsgQueueProperty( ULONG hmq, ULONG ulFlag )
     347{
     348    USHORT sel;
     349    APIRET rc;
     350
     351    if( !pfnImSetMsgQueueProperty )
     352        return 1;
     353
     354    sel = RestoreOS2FS();
     355    rc = pfnImSetMsgQueueProperty( hmq, ulFlag );
     356    SetFS( sel );
     357
     358    return rc;
     359}
     360//******************************************************************************
     361//******************************************************************************
     362
Note: See TracChangeset for help on using the changeset viewer.