当前位置: 首页>>代码示例>>C++>>正文


C++ DosGetInfoBlocks函数代码示例

本文整理汇总了C++中DosGetInfoBlocks函数的典型用法代码示例。如果您正苦于以下问题:C++ DosGetInfoBlocks函数的具体用法?C++ DosGetInfoBlocks怎么用?C++ DosGetInfoBlocks使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DosGetInfoBlocks函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: __PHYSFS_platformGetThreadID

PHYSFS_uint64 __PHYSFS_platformGetThreadID(void)
{
    PTIB ptib;
    PPIB ppib;

    /*
     * Allegedly, this API never fails, but we'll punt and return a
     *  default value (zero might as well do) if it does.
     */
    BAIL_IF_MACRO(os2err(DosGetInfoBlocks(&ptib, &ppib)) != NO_ERROR, 0, 0);
    return((PHYSFS_uint64) ptib->tib_ordinal);
} /* __PHYSFS_platformGetThreadID */
开发者ID:UIKit0,项目名称:paragui,代码行数:12,代码来源:os2.c

示例2: _sendQuery

static BOOL _sendQuery(PGROPDATA pGrop, PGROPQUERY pQuery, BOOL fPrivateEvSem)
{
  ULONG      ulRC;
  BOOL       fSuccess;
  PTIB       tib;
  PPIB       pib;

  DosGetInfoBlocks( &tib, &pib );
  if ( tib->tib_ptib2->tib2_ultid == pGrop->tid )
  {
    // Query send from callback function.
    debug( "Query send from callback function." );

    pQuery->hevReady = NULLHANDLE;
    _wmGropQuery( pGrop, pQuery );
    return pQuery->fSuccess;
/*    return (BOOL)WinSendMsg( pGrop->hwnd, WM_GROP_QUERY, MPFROMP( pQuery ), 0 )
             && pQuery->fSuccess;*/
  }

  if ( fPrivateEvSem )
  {
    ulRC = DosCreateEventSem( NULL, &pQuery->hevReady, 0, FALSE );
    if ( ulRC != NO_ERROR )
    {
      debug( "DosCreateEventSem(), rc = %u.", ulRC );
      return FALSE;
    }
  }
  else
    pQuery->hevReady = pGrop->hevReady;

  fSuccess = WinPostMsg( pGrop->hwnd, WM_GROP_QUERY, MPFROMP( pQuery ), 0 );
  if ( !fSuccess )
  {
    debug( "WinPostMsg() failed" );
  }
  else
  {
    ulRC = DosWaitEventSem( pQuery->hevReady, 3000 );
    if ( ulRC != NO_ERROR )
    {
      debug( "DosWaitEventSem(), rc = %u.", ulRC );
    }
    fSuccess = pQuery->fSuccess;
  }

  if ( fPrivateEvSem )
    DosCloseEventSem( pQuery->hevReady );

  return fSuccess;
}
开发者ID:OS2World,项目名称:LIB-SDL-2014,代码行数:52,代码来源:grop.c

示例3: os2MutexNotheld

static int os2MutexNotheld(sqlite3_mutex *p){
  TID tid;
  PID pid;
  ULONG ulCount;
  PTIB ptib;
  if( p!= 0 ) {
    DosQueryMutexSem(p->mutex, &pid, &tid, &ulCount);
  } else {
    DosGetInfoBlocks(&ptib, NULL);
    tid = ptib->tib_ptib2->tib2_ultid;
  }
  return p==0 || p->nRef==0 || p->owner!=tid;
}
开发者ID:KnowNo,项目名称:test-code-backup,代码行数:13,代码来源:mutex_os2.c

示例4: DosGetInfoBlocks

static unsigned char *get_cmdline( void )
   {
   PTIB            ptib;
   PPIB            ppib;

   /* Get a pointer to the first through n arguments that were entered on     */
   /* the command line.                                                       */

   DosGetInfoBlocks( &ptib, &ppib );

   return (ppib->pib_pchcmd);

   }
开发者ID:OS2World,项目名称:DEV-SAMPLES-WorkFrame2,代码行数:13,代码来源:DOSCL1.C

示例5: morph

void morph(void)
{
PPIB ppib = NULL;
PTIB ptib = NULL;
APIRET rc;

	rc = DosGetInfoBlocks(&ptib,&ppib);
	if (rc != NO_ERROR)
		{
		printf("DosGetInfoBlocks Error : %d\n",rc);
		exit(-1);
		}
	ppib->pib_ultype = 3;
}
开发者ID:komh,项目名称:hanedit2,代码行数:14,代码来源:HEFTest.c

示例6: return

    static char *OS_GET_CMD_LINE( void )
    {
        PTIB    tib;
        PPIB    pib;
        char    *cmd;

        if( DosGetInfoBlocks(&tib, &pib) )
            return( NULL );

        cmd = pib->pib_pchcmd;
        while( *cmd ) ++cmd;    /* skip over second copy of program name */
        ++cmd;
        return( cmd );
    }
开发者ID:NoSuchProcess,项目名称:open-watcom-v2,代码行数:14,代码来源:gtcmd.c

示例7: EnumConfigPaths

bool EnumConfigPaths(char *Path,int Number)
{
#ifdef _EMX
  static char RARFileName[NM];
  if (Number==-1)
    strcpy(RARFileName,Path);
  if (Number!=0)
    return(false);
  if (_osmode==OS2_MODE)
  {
    PTIB ptib;
    PPIB ppib;
    DosGetInfoBlocks(&ptib, &ppib);
    DosQueryModuleName(ppib->pib_hmte,NM,Path);
  }
  else
    strcpy(Path,RARFileName);
  RemoveNameFromPath(Path);
  return(true);
#elif defined(_UNIX)
  if (Number==0)
  {
    char *EnvStr=getenv("HOME");
    if (EnvStr==NULL)
      return(false);
    strncpy(Path,EnvStr,NM);
    Path[NM-1]=0;
    return(true);
  }
  static const char *AltPath[]={
    "/etc","/usr/lib","/usr/local/lib","/usr/local/etc"
  };
  Number--;
  if (Number<0 || Number>=(int)(sizeof(AltPath)/sizeof(AltPath[0])))
    return(false);
  strcpy(Path,AltPath[Number]);
  return(true);
#elif defined(_WIN_32)
  if (Number!=0)
    return(false);
#if !defined(_LINUX)
  GetModuleFileName(NULL,Path,NM);
  RemoveNameFromPath(Path);
#endif
  return(true);
#else
  return(false);
#endif
}
开发者ID:1ibraheem,项目名称:xbmc,代码行数:49,代码来源:pathfn.cpp

示例8: enable_os2_iostreams

  static
  void  enable_os2_iostreams( void )
  {
    PTIB  thread_block;
    PPIB  process_block;

    /* XXX : This is a very nasty hack, it fools OS/2 and let the program */
    /*       call PM functions, even though stdin/stdout/stderr are still */
    /*       directed to the standard i/o streams..                       */
    /*       The program must be compiled with WINDOWCOMPAT               */
    /*                                                                    */
    /*   Credits go to Michal for finding this !!                         */
    /*                                                                    */
    DosGetInfoBlocks( &thread_block, &process_block );
    process_block->pib_ultype = 3;
  }
开发者ID:Frankie-666,项目名称:color-emoji.freetype2-demos,代码行数:16,代码来源:gros2pm.c

示例9: getSGID

ULONG APIENTRY getSGID( VOID )
{
    PQTOPLEVEL  pQTopLevel = ( PQTOPLEVEL )m_achSysState;
    PPIB        ppib;

    if( m_ulSGID != ( ULONG )-1 )
        return m_ulSGID;

    DosGetInfoBlocks( NULL, &ppib );

    DosQuerySysState( 0x01, 0, ppib->pib_ulpid, 1, pQTopLevel, BUF_SIZE );

    m_ulSGID = pQTopLevel->procdata->sessid;

    return m_ulSGID;
}
开发者ID:OS2World,项目名称:UTIL-SHELL-KShell,代码行数:16,代码来源:viosub.c

示例10: archdep_init

int archdep_init(int *argc, char **argv)
{
    /* This is right way to do this in OS/2 (not via argv[0]) */
    TIB *pTib;
    PIB *pPib;

    DosGetInfoBlocks(&pTib, &pPib);
    DosQueryModuleName(pPib->pib_hmte, CCHMAXPATH, argv0);

    orig_workdir = (char *)getcwd(NULL, CCHMAXPATH);
    atexit(restore_workdir);

    PM_open();

#if !defined __X1541__ && !defined __PETCAT__
    archdep_create_mutex_sem(&hmtxSpawn, "Spawn", FALSE);
#endif

    return 0;
}
开发者ID:BigBoss21X,项目名称:vice-emu,代码行数:20,代码来源:archdep.c

示例11: init_pm

int init_pm(void)
{
    PPIB pib;
    PTIB tib;
    APIRET rc;
    HMODULE hMte = 0;
    char loadErr[256];

    if(hab || hmq)
        return 0;

    rc = DosGetInfoBlocks(&tib, &pib);

    rc = DosQueryModuleHandle("PMWIN", &hMte);

    if(rc)
        return 1;

    pib->pib_ultype = 3;

    rc = DosLoadModule(loadErr, sizeof(loadErr), "PMWIN", &hMte);

    if(rc)
        return 1;

    rc = DosQueryProcAddr(hMte, 707, 0, (PFN*)&_inCloseClipbrd);
    rc = DosQueryProcAddr(hMte, 716, 0, (PFN*)&_inCreateMsgQueue);
    rc = DosQueryProcAddr(hMte, 726, 0, (PFN*)&_inDestroyMsgQueue);
    rc = DosQueryProcAddr(hMte, 733, 0, (PFN*)&_inEmptyClipbrd);
    rc = DosQueryProcAddr(hMte, 763, 0, (PFN*)&_inInitialize);
    rc = DosQueryProcAddr(hMte, 793, 0, (PFN*)&_inOpenClipbrd);
    rc = DosQueryProcAddr(hMte, 806, 0, (PFN*)&_inQueryClipbrdData);
    rc = DosQueryProcAddr(hMte, 807, 0, (PFN*)&_inQueryClipbrdFmtInfo);
    rc = DosQueryProcAddr(hMte, 854, 0, (PFN*)&_inSetClipbrdData);
    rc = DosQueryProcAddr(hMte, 888, 0, (PFN*)&_inTerminate);

    hab = _inInitialize(0);
    hmq = _inCreateMsgQueue(hab, 0);

    return 0;
}
开发者ID:OS2World,项目名称:UTIL-CLIPBOARD-Clip,代码行数:41,代码来源:clip.cpp

示例12: __objc_thread_get_priority

/* Return the current thread's priority. */
int
__objc_thread_get_priority(void)
{
  PTIB ptib;
  PPIB ppib;

  /* get information about current thread */
  DosGetInfoBlocks (&ptib,&ppib);

  switch (ptib->tib_ptib2->tib2_ulpri)
    {
    case PRTYC_IDLETIME:
    case PRTYC_REGULAR:
    case PRTYC_TIMECRITICAL:
    case PRTYC_FOREGROUNDSERVER:
    default:
      return OBJC_THREAD_INTERACTIVE_PRIORITY;
    }

  return -1;
}
开发者ID:DJHartley,项目名称:iphone-dev,代码行数:22,代码来源:thr-os2.c

示例13: RTSysInit

unsigned        RTSysInit( void ) {
//===========================

    if( RTSysInitialized ) return( 0 );
#if defined( __OS2__ ) && defined( __386__ )
    {
        #define INCL_DOSPROCESS
        #include <os2.h>

        TIB     *ptib;
        PIB     *ppib;

        DosGetInfoBlocks( &ptib, &ppib );
        if( ppib->pib_ultype == 3 ) {
            if( _WindowsStdout == 0 ) {
                __FAppType = FAPP_GUI;
            } else {
                __FAppType = FAPP_DEFAULT_GUI;
            }
        }
    }
#elif defined( __NT__ )
    {
        if( _WindowsStdout != 0 ) {
            __FAppType = FAPP_DEFAULT_GUI;
        }
    }
#endif
    // WATFOR-77 calls __ErrorInit() when it starts
    __ErrorInit( _LpPgmName );
    RTSysInitialized = 1;
    __InitRTData(); // for main thread
    _ExceptionInit();
    // call to RTSysFini() is done in LGSysFini() for load'n go
    // (i.e. we must call RTSysFini() after each time we execute, not when
    // WATFOR-77 exits in case we are operating in batch mode)
    atexit( &RTSysFini );
    return( 0 );
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:39,代码来源:rtinit.c

示例14: DosGetInfoBlocks

/*--------------------------------------------------------------------------------------*\
 * UApm : intialize()                                                                   *
\*--------------------------------------------------------------------------------------*/
UApm                   &UApm::initialize(void)
{
    TIB    *ptib;                       /* Thread information block */
    PIB    *ppib;                       /* Process information block */
    char   *pcTemp;

                                        /* Query the fully qualified path APM/2 was loaded from.
                                           Once we know the language to use we replace ".exe"
                                           by e.g. "xx.msg" where xx is the NLS message file,
                                           but for now we assume English as this one is shipped
                                           with APM/2 for sure */
    DosGetInfoBlocks(&ptib, &ppib);
    DosQueryModuleName(ppib->pib_hmte, sizeof(acMessageFileUs), (PCHAR)acMessageFileUs);
    pcCommandline=strdup(strchr(ppib->pib_pchcmd, '\0')+1);
    pcTemp=strrchr(acMessageFileUs, '.');
    if(pcTemp!=0)
        strcpy(pcTemp, "Us.msg");
    strcpy(acMessageFileNls, acMessageFileUs);
                                        /* Query the version we're running */
    DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_VERSION_MINOR, ulVersion, sizeof(ulVersion));
    return(*this);
}
开发者ID:OS2World,项目名称:CMD-Tools,代码行数:25,代码来源:Apm.cpp

示例15: DosScanEnv

APIRET APIENTRY  DosScanEnv(PCSZ  pszName,
                            PSZ  *ppszValue)
{
  char varname[CCHMAXPATH];
  PPIB pib;
  PTIB tib;
  int  i;
  char *p, *q, *env;

  /* Get application info blocks */
  DosGetInfoBlocks(&tib, &pib);

  /* get the environment */
  env = pib->pib_pchenv;

  /* search for needed env variable */
  for (p = env; *p; p += strlen(p) + 1)
  {
    // move until '=' sign is encountered
    for (i = 0, q = p; *q && *q != '=' && i < CCHMAXPATH - 1; q++, i++) ;

    /* copy to name buffer  */
    strncpy(varname, p, i);
    /* add ending zero byte */
    varname[i] = '\0';

    if (!strcasecmp(varname, pszName))
    {
      /* variable found */
      *ppszValue = q + 1;

      return NO_ERROR;
    }
  }

  return ERROR_ENVVAR_NOT_FOUND;
}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:37,代码来源:env.c


注:本文中的DosGetInfoBlocks函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。