PortAudio  2.0
Macros | Functions
pa_win_coinitialize.c File Reference

Microsoft COM initialization routines. More...

#include <windows.h>
#include <objbase.h>
#include "portaudio.h"
#include "pa_util.h"
#include "pa_debugprint.h"
#include "pa_win_coinitialize.h"

Macros

#define PAWINUTIL_COM_INITIALIZED   (0xb38f)
 
#define PAWINUTIL_COM_NOT_INITIALIZED   (0xf1cd)
 

Functions

PaError PaWinUtil_CoInitialize (PaHostApiTypeId hostApiType, PaWinUtilComInitializationResult *comInitializationResult)
 Initialize Microsoft COM subsystem on the current thread. More...
 
void PaWinUtil_CoUninitialize (PaHostApiTypeId hostApiType, PaWinUtilComInitializationResult *comInitializationResult)
 Uninitialize the Microsoft COM subsystem on the current thread using the result of a previous call to PaWinUtil_CoInitialize. Must be called on the same thread as PaWinUtil_CoInitialize. More...
 

Detailed Description

Microsoft COM initialization routines.

Macro Definition Documentation

#define PAWINUTIL_COM_INITIALIZED   (0xb38f)
#define PAWINUTIL_COM_NOT_INITIALIZED   (0xf1cd)

Function Documentation

PaError PaWinUtil_CoInitialize ( PaHostApiTypeId  hostApiType,
PaWinUtilComInitializationResult comInitializationResult 
)

Initialize Microsoft COM subsystem on the current thread.

Parameters
hostApiTypethe host API type id of the caller. Used for error reporting.
comInitializationResultAn output parameter. The value pointed to by this parameter stores information required by PaWinUtil_CoUninitialize to correctly uninitialize COM. The value should be retained and later passed to PaWinUtil_CoUninitialize.

If PaWinUtil_CoInitialize returns paNoError, the caller must later call PaWinUtil_CoUninitialize once.

References PaWinUtilComInitializationResult::initializingThreadId, PA_DEBUG, paInsufficientMemory, paNoError, paUnanticipatedHostError, PaUtil_SetLastHostErrorInfo(), PAWINUTIL_COM_INITIALIZED, PAWINUTIL_COM_NOT_INITIALIZED, and PaWinUtilComInitializationResult::state.

Referenced by PaAsio_Initialize(), PaAsio_ShowControlPanel(), PaWasapi_Initialize(), and PaWinDs_Initialize().

void PaWinUtil_CoUninitialize ( PaHostApiTypeId  hostApiType,
PaWinUtilComInitializationResult comInitializationResult 
)

Uninitialize the Microsoft COM subsystem on the current thread using the result of a previous call to PaWinUtil_CoInitialize. Must be called on the same thread as PaWinUtil_CoInitialize.

Parameters
hostApiTypethe host API type id of the caller. Used for error reporting.
comInitializationResultAn input parameter. A pointer to a value previously initialized by a call to PaWinUtil_CoInitialize.

References PaWinUtilComInitializationResult::initializingThreadId, PA_DEBUG, PAWINUTIL_COM_INITIALIZED, PAWINUTIL_COM_NOT_INITIALIZED, and PaWinUtilComInitializationResult::state.

Referenced by PaAsio_Initialize(), and PaAsio_ShowControlPanel().