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


C++ DosFreeModule函数代码示例

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


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

示例1: VManInit

static BOOL VManInit(SDL_PrivateVideoData *pPVData)
{
  CHAR			achBuf[256];
  ULONG			ulRC;
  INITPROCOUT		sInitProcOut;

  ulRC = DosLoadModule( achBuf, sizeof(achBuf), "VMAN", &hmodVMan );
  if ( ulRC != NO_ERROR )
  {
    debug( "Could not load VMAN.DLL, rc = %u : %s", ulRC, achBuf );
    return FALSE;
  }

  ulRC = DosQueryProcAddr( hmodVMan, 0L, "VMIEntry", (PFN *)&pfnVMIEntry );
  if ( ulRC != NO_ERROR )
  {
    debug( "Could not query address of pfnVMIEntry function of VMAN.DLL, "
           "rc = %u", ulRC );
    DosFreeModule( hmodVMan );
    hmodVMan = NULLHANDLE;
    return FALSE;
  }

  sInitProcOut.ulLength = sizeof(sInitProcOut);
  ulRC = pfnVMIEntry( 0, VMI_CMD_INITPROC, NULL, &sInitProcOut );
  if ( ulRC != RC_SUCCESS )
  {
    debug( "Could not initialize VMAN for this process" );
    DosFreeModule( hmodVMan );
    hmodVMan = NULLHANDLE;
    return FALSE;
  }


  if ( pPVData == NULL )
  {
    // It only check VMan availability...
    pfnVMIEntry( 0, VMI_CMD_TERMPROC, NULL, NULL );
    return TRUE;
  }

  ulVRAMAddress = sInitProcOut.ulVRAMVirt;

  // Set routine that run when the current process ends, before PM-related
  // internal procedure.
  ulRC = DosExitList( EXLST_ADD
                     | 0x00009900, // Before Presentation Manager (0xA0 - 0xA8)
                     _AtExit );

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

示例2: DrvMountDrivesThread

void        DrvMountDrivesThread( void * hev)

{
    ULONG       rc;
    HMODULE     hmod = 0;
    pRediscover_PRMs    pfn = 0;
    char *      pErr = 0;
    char        szErr[16];

    rc = DosLoadModule( szErr, sizeof(szErr), "LVM", &hmod);
    if (rc)
        pErr = "DosLoadModule";
    else {
        rc = DosQueryProcAddr( hmod, 0, "Rediscover_PRMs", (PFN*)&pfn);
        if (rc)
            pErr = "DosQueryProcAddr";
        else {
            pfn( &rc);
            if (rc)
                pErr = "Rediscover_PRMs";
        }
        rc = DosFreeModule( hmod);
        if (rc && !pErr)
            pErr = "DosFreeModule";
    }

    if (pErr)
        printf( "DrvMountDrivesThread - %s - rc= %lx\n", pErr, rc);

    rc = DosPostEventSem( (HEV)hev);
    if (rc)
        printf( "DrvMountDrivesThread - DosPostEventSem - rc= %lx\n", rc);

    return;
}
开发者ID:OS2World,项目名称:APP-GRAPHICS-Cameraderie,代码行数:35,代码来源:camdrive.c

示例3: RemovePlugin

// RemovePlugin(hwnd, pTBData, dllName, appName, bActive)
//    hwnd     --> Handle of the calling window
//    pTBData  --> Pointer to the titlebar's CandyBarZ data structure
//    index    --> index of the plugin to be removed
BOOL RemovePlugin( /*HWND hwnd, */ CBZDATA *pCBZData, int index)
{
    //remove the plugin from the given index, and move all plugins below it up 1
    int i, count;

    if ((index >= pCBZData->cbPlugins) || (index < 0))
        return (FALSE);
    count = pCBZData->cbPlugins;

    //free resources of removed plugin
    if (pCBZData->Plugins[index].hModDll != NULLHANDLE)
        DosFreeModule(pCBZData->Plugins[index].hModDll);
//should call the CBZDestroy Function here instead!
    if (pCBZData->Plugins[index].pData != NULL)
        DosFreeMem(pCBZData->Plugins[index].pData);

    //move the lower plugins up 1
    for (i = index; i < count; i++)
    {
        SwapPlugins(pCBZData, i, i + 1);
    }

    //update the plugin count
    pCBZData->cbPlugins--;

    return (TRUE);
}
开发者ID:OS2World,项目名称:UTIL-WPS-CandyBarz,代码行数:31,代码来源:themebuilderutil.c

示例4: ReloadResources

BOOL Settings :: ReloadResources (PSZ psz)
{
    if (g_hmod)
        DosFreeModule(g_hmod);

    APIRET  rc;

    if ((rc = DosLoadModule(PSZ(NULL), 0, psz, &g_hmod)))
    {
        DisplayError("ERROR", "Could not (re)load Gotcha! resource module "
                     "'%s' (DosLoadModule() return code %d). First make sure the DLL is in the LIBPATH. If this is the case, try to delete "
                     "GOTCHA.INI and start Gotcha! again. If it does not work "
                     "then, contact the author ([email protected]).", psz, rc);
        exit(1);
    }

    ResourceString::Module(g_hmod);

    pszPageTab[0] = RSTR (IDS_PAGESAVE);
    pszPageTab[1] = RSTR (IDS_PAGESNAPSHOT);
    pszPageTab[2] = RSTR (IDS_PAGEMISC);
    pszPageTab[3] = RSTR (IDS_PAGELANGUAGE);

    for( int i = 0; i < BMF_INVALID; i++ ) {
        ifi[ i ].label = RSTR ( IDS_BITMAP12INTERNAL+i ); }

    return TRUE;
}
开发者ID:OS2World,项目名称:APP-GRAPHICS-Gotcha,代码行数:28,代码来源:settings.cpp

示例5: ExitListRoutine

VOID ExitListRoutine( ULONG ExitReason )
{
  SpyDeRegister( SpyInstance );       /* De-Register with our DLL */

  if ( hSwitch != NULLH )
     WinRemoveSwitchEntry(hSwitch);

  if ( hwndFrame != NULLH )
    WinDestroyWindow(hwndFrame);

  if ( hmq != NULLH )
    WinDestroyMsgQueue(hmq);

  /* cleanup STRINGTABLEs loaded for us... */

  FreeStringTable(sizeof(Strings) / sizeof(Strings[0]),  /* max # Strings[] */
                  Strings);                              /* start of string table */

  FreeStringTable(sizeof(Controls) / sizeof(Controls[0]), /* max # Controls[] */
                  Controls);                         /* start of string table */

  if ( hmodNLS != 0 )
    DosFreeModule(hmodNLS);

  if ( hab != 0 )
    WinTerminate(hab);

  DosExitList(EXLST_EXIT, NULL);                /* Indicate "done" */
}
开发者ID:OS2World,项目名称:DEV-SAMPLES-The-IBM-Developer-Connection-Release-12,代码行数:29,代码来源:PMSPY.C

示例6: LogFlowThisFunc

/**
 * Stop all service threads and free the device chain.
 */
USBProxyServiceOs2::~USBProxyServiceOs2()
{
    LogFlowThisFunc(("\n"));

    /*
     * Stop the service.
     */
    if (isActive())
        stop();

    /*
     * Free resources.
     */
    if (mhmod)
    {
        if (mpfnUsbDeregisterNotification)
            mpfnUsbDeregisterNotification(mNotifyId);

        mpfnUsbRegisterChangeNotification = NULL;
        mpfnUsbDeregisterNotification = NULL;
        mpfnUsbQueryNumberDevices = NULL;
        mpfnUsbQueryDeviceReport = NULL;

        DosFreeModule(mhmod);
        mhmod = NULLHANDLE;
    }
}
开发者ID:svn2github,项目名称:virtualbox,代码行数:30,代码来源:USBProxyBackendOs2.cpp

示例7: MADSysLoad

mad_status MADSysLoad( const char *path, mad_client_routines *cli,
                       mad_imp_routines **imp, mad_sys_handle *sys_hdl )
{
    HMODULE             dll;
    mad_init_func       *init_func;
    mad_status          status;
    char                madname[CCHMAXPATH] = "";
    char                madpath[CCHMAXPATH] = "";

    /* To prevent conflicts with the 16-bit MAD DLLs, the 32-bit versions have the "D32"
     * extension. We will search for them along the PATH (not in LIBPATH);
     */
    strcpy( madname, path );
    strcat( madname, ".D32" );
    _searchenv( madname, "PATH", madpath );
    if( madpath[0] == '\0' || DosLoadModule( NULL, 0, madpath, &dll ) != 0 ) {
        return( MS_ERR|MS_FOPEN_FAILED );
    }
    status = MS_ERR|MS_INVALID_MAD;
    if( DosQueryProcAddr( dll, 0, "MADLOAD", (PFN FAR *)&init_func ) == 0
      && (*imp = init_func( &status, cli )) != NULL ) {
        *sys_hdl = dll;
        return( MS_OK );
    }
    DosFreeModule( dll );
    return( status );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:27,代码来源:madld.c

示例8: hb_libFree

HB_BOOL hb_libFree( PHB_ITEM pDynLib )
{
   HB_BOOL fResult = HB_FALSE;
   void ** pDynLibPtr = ( void ** ) hb_itemGetPtrGC( pDynLib, &s_gcDynlibFuncs );

   if( pDynLibPtr && *pDynLibPtr &&
       hb_vmLockModuleSymbols() )
   {
      void * hDynLib = *pDynLibPtr;
      if( hDynLib )
      {
         *pDynLibPtr = NULL;
         hb_vmExitSymbolGroup( hDynLib );
#if defined( HB_OS_WIN )
         fResult = FreeLibrary( ( HMODULE ) hDynLib );
#elif defined( HB_OS_OS2 )
         fResult = DosFreeModule( ( HMODULE ) hDynLib ) == NO_ERROR;
#elif defined( HB_HAS_DLFCN )
         fResult = dlclose( hDynLib ) == 0;
#elif defined( HB_CAUSEWAY_DLL )
         FreeLibrary( hDynLib );
         fResult = HB_TRUE;
#endif
      }
      hb_vmUnlockModuleSymbols();
   }

   return fResult;
}
开发者ID:emazv72,项目名称:core,代码行数:29,代码来源:dynlibhb.c

示例9: SupportsNumberOfPagesQuery

/* Depending on GBM.DLL version the number of pages can be retrieved (versions > 1.35)
 * or the functionality does not yet exist.
 *
 * Dynamically link the specific function to support also older versions of GBM.DLL.
 */
gbm_boolean SupportsNumberOfPagesQuery(void)
{
#if defined(__OS2__) || defined(OS2)

   HMODULE hmod;
   PFN     functionAddr = NULL;
   APIRET  rc = 0;

   /* check version first */
   if (gbm_version() < 135)
   {
      return GBM_FALSE;
   }

   /* now dynamically link GBM.DLL */
   rc = DosLoadModule("", 0, "GBM", &hmod);
   if (rc)
   {
      return GBM_FALSE;
   }

   /* lookup gbm_read_imgcount() */
   rc = DosQueryProcAddr(hmod, 0L, "gbm_read_imgcount", &functionAddr);

   DosFreeModule(hmod);

   return rc ? GBM_FALSE : GBM_TRUE;
#else
   /* On all other platforms we assume so far that the correct lib is there. */
   return GBM_TRUE;
#endif
}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:37,代码来源:gbmhdr.c

示例10: dlclose

/* free dynamically-linked library */
int dlclose(void *handle)
{
    int rc;
    DLLchain tmp = find_id(handle);

    if (!tmp)
        goto inv_handle;

    switch (rc = DosFreeModule(tmp->handle))
    {
        case NO_ERROR:
            free(tmp->name);
            dlload = tmp->next;
            free(tmp);
            return 0;
        case ERROR_INVALID_HANDLE:
inv_handle:
            strcpy(dlerr, "invalid module handle");
            return -1;
        case ERROR_INVALID_ACCESS:
            strcpy(dlerr, "access denied");
            return -1;
        default:
            return -1;
    }
}
开发者ID:0xcc,项目名称:python-read,代码行数:27,代码来源:dlfcn.c

示例11: _catcher

/* *************************************************************** */
void _catcher(bundle s)
{
    char    msg[512];
    char   *b[4];
    HMODULE hmod;
    PFNWP   DlgProc;
    int  c  = 0,
         bx = 0;

    if (msgHead != NULL) {
      for (msg[0] = '\0'; *msgHead != NULL; ++msgHead) strcat(msg,*msgHead);
      b[bx++] = msg;
      c = strlen(msg) + 1;
    }
    for (msg[c] = '\0'; *s != NULL; ++s) strcat(&msg[c],*s);
    b[bx++] = &msg[c];
    b[bx++] = "Application will terminate now";
    b[bx]   = NULL;

    if (DosLoadModule(NULL, 0, "GPRTS", &hmod) ||
        DosQueryProcAddr(hmod, 0, "DlgProc", (PFN *)&DlgProc))
      WinMessageBox(HWND_DESKTOP, HWND_DESKTOP,
                    "Unable to load error message","GPM Fatal Error",
                    0, MB_ICONHAND | MB_OK);
    else {
      WinAlarm(HWND_DESKTOP, WA_ERROR);
      WinDlgBox(HWND_DESKTOP, HWND_DESKTOP, DlgProc, hmod, GPRTS_DLG, b);
      DosFreeModule(hmod);
    }
    DosExit(EXIT_PROCESS, 0);
}
开发者ID:2nickpick,项目名称:c-minus,代码行数:32,代码来源:gprts.c

示例12: DosLoadModule

// Obtains all of the information currently available for this plugin.
nsresult nsPluginFile::GetPluginInfo( nsPluginInfo &info)
{
   nsresult   rv = NS_ERROR_FAILURE;
   HMODULE    hPlug = 0; // Need a HMODULE to query resource statements
   char       failure[ CCHMAXPATH] = "";
   APIRET     ret;

   nsCAutoString path;
   if (NS_FAILED(rv = mPlugin->GetNativePath(path)))
     return rv;

   nsCAutoString fileName;
   if (NS_FAILED(rv = mPlugin->GetNativeLeafName(fileName)))
     return rv;

   ret = DosLoadModule( failure, CCHMAXPATH, path.get(), &hPlug);
   info.fVersion = nsnull;

   while( ret == NO_ERROR)
   {
      info.fName = LoadRCDATAString( hPlug, NS_INFO_ProductName);

      info.fVersion = LoadRCDATAVersion( hPlug, NS_INFO_ProductVersion);

      // get description (doesn't matter if it's missing)...
      info.fDescription = LoadRCDATAString( hPlug, NS_INFO_FileDescription);

      char * mimeType = LoadRCDATAString( hPlug, NS_INFO_MIMEType);
      if( nsnull == mimeType) break;

      char * mimeDescription = LoadRCDATAString( hPlug, NS_INFO_FileOpenName);
      if( nsnull == mimeDescription) break;

      char * extensions = LoadRCDATAString( hPlug, NS_INFO_FileExtents);
      if( nsnull == extensions) break;

      info.fVariantCount = CalculateVariantCount(mimeType);

      info.fMimeTypeArray = MakeStringArray(info.fVariantCount, mimeType);
      if( info.fMimeTypeArray == nsnull) break;

      info.fMimeDescriptionArray = MakeStringArray(info.fVariantCount, mimeDescription);
      if( nsnull == info.fMimeDescriptionArray) break;

      info.fExtensionArray = MakeStringArray(info.fVariantCount, extensions);
      if( nsnull == info.fExtensionArray) break;

      info.fFullPath = PL_strdup(path.get());
      info.fFileName = PL_strdup(fileName.get());

      rv = NS_OK;
      break;
   }

   if( 0 != hPlug)
      DosFreeModule( hPlug);

   return rv;
}
开发者ID:amyvmiwei,项目名称:firefox,代码行数:60,代码来源:nsPluginsDirOS2.cpp

示例13: XPCOMGlueUnload

void
XPCOMGlueUnload()
{
    while (sTop) {
        DosFreeModule(sTop->libHandle);

        DependentLib *temp = sTop;
        sTop = sTop->next;

        delete temp;
    }

    if (sXULLibrary) {
        DosFreeModule(sXULLibrary);
        sXULLibrary = nsnull;
    }
}
开发者ID:Akin-Net,项目名称:mozilla-central,代码行数:17,代码来源:nsGlueLinkingOS2.cpp

示例14: defined

/* static */
void wxDynamicLibrary::Unload(wxDllType handle)
{
#if defined(__OS2__) || defined(__EMX__)
    DosFreeModule( handle );
#else
    #error  "runtime shared lib support not implemented"
#endif
}
开发者ID:chromylei,项目名称:third_party,代码行数:9,代码来源:dynlib.cpp

示例15: IM32Term

VOID IM32Term( VOID )
{
    if( !fIM32Inited )
        return;

    DosFreeModule( hIM32Mod );

    fIM32Inited = FALSE;
}
开发者ID:komh,项目名称:kime,代码行数:9,代码来源:im32.c


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