Skip to content
Snippets Groups Projects
Commit e0df21fe authored by Lyubomir Marinov's avatar Lyubomir Marinov
Browse files

Fixes a REGDB_E_CLASSNOTREG in jnwincoreaudio. Reported by Vincent Lucas.

parent 450ba99e
No related branches found
No related tags found
No related merge requests found
......@@ -675,15 +675,22 @@
description="Build jnwincoreaudio shared library for Windows Vista, 7 and 8"
if="is.running.windows"
depends="init-native">
<cc outtype="shared" name="g++"
outfile="${native_install_dir}/jnwincoreaudio" objdir="${obj}">
<cc name="gcc"
objdir="${obj}"
outfile="${native_install_dir}/jnwincoreaudio"
outtype="shared">
<compilerarg value="-Wall" />
<compilerarg value="-O2" />
<compilerarg value="-D_JNI_IMPLEMENTATION_" />
<compilerarg value="-D_WIN32_WINNT=0x0600" />
<compilerarg value="-DWINVER=0x0600" />
<compilerarg value="-I${system.JAVA_HOME}/include" />
<compilerarg value="-I${system.JAVA_HOME}/include/win32" />
<compilerarg value="-O2" />
<compilerarg value="-Wall" />
<compilerarg value="-xc++" />
<linkerarg value="-ojnwincoreaudio.dll" />
<linkerarg value="-Wl,--kill-at" />
<libset libs="ole32" />
<fileset dir="${src}/native/windows/coreaudio/lib" includes="*.c" />
......
......@@ -14,7 +14,7 @@
#include <propkeydef.h> // Must be defined after windows.h
#include <commctrl.h> // Must be defined after mmdeviceapi.h
#include "include/endpointvolume.h" // Must be defined after mmdeviceapi.h
#include <endpointvolume.h> // Must be defined after mmdeviceapi.h
/**
* Functions to list, access and modifies audio devices via coreaudio.
......@@ -40,9 +40,6 @@ float getDeviceVolume(
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14); // DEVPROP_TYPE_STRING
const IID IID_IAudioEndpointVolume =
{0x5CDF2C82, 0x841E, 0x4546, {0x97, 0x22, 0x0C, 0xF7, 0x40, 0x78, 0x22, 0x9A}};
/**
* Initializes the COM component. This function must be called first in order to
* able each following function to work correctly. Once finished, the caller of
......@@ -92,16 +89,14 @@ IMMDevice * getDevice(
const char * deviceUID)
{
// Gets the enumerator of the system devices.
int err;
HRESULT err;
IMMDeviceEnumerator * enumerator = NULL;
const CLSID clsid = __uuidof(MMDeviceEnumerator);
const IID iid = __uuidof(IMMDeviceEnumerator);
if((err = CoCreateInstance(
clsid,
CLSID_MMDeviceEnumerator,
NULL,
CLSCTX_ALL,
iid,
IID_IMMDeviceEnumerator,
(void**) &enumerator))
!= S_OK)
{
......
This diff is collapsed.
/*
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
winapifamily.h
Abstract:
Master include file for API family partitioning.
*/
#ifndef _INC_WINAPIFAMILY
#define _INC_WINAPIFAMILY
#if defined(_MSC_VER) && !defined(MOFCOMP_PASS)
#pragma once
#endif // defined(_MSC_VER) && !defined(MOFCOMP_PASS)
/*
* Windows APIs can be placed in a partition represented by one of the below bits. The
* WINAPI_FAMILY value determines which partitions are available to the client code.
*/
#define WINAPI_PARTITION_DESKTOP 0x00000001
#define WINAPI_PARTITION_APP 0x00000002
/*
* A family may be defined as the union of multiple families. WINAPI_FAMILY should be set
* to one of these values.
*/
#define WINAPI_FAMILY_APP WINAPI_PARTITION_APP
#define WINAPI_FAMILY_DESKTOP_APP (WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_APP)
/*
* A constant that specifies which code is available to the program's target runtime platform.
* By default we use the 'desktop app' family which places no restrictions on the API surface.
* To restrict the API surface to just the App API surface, define WINAPI_FAMILY to WINAPI_FAMILY_APP.
*/
#ifndef WINAPI_FAMILY
#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
#endif
/* Macro to determine if a partition is enabled */
#define WINAPI_FAMILY_PARTITION(Partition) ((WINAPI_FAMILY & Partition) == Partition)
/* Macro to determine if only one partition is enabled from a set */
#define WINAPI_FAMILY_ONE_PARTITION(PartitionSet, Partition) ((WINAPI_FAMILY & PartitionSet) == Partition)
/*
* Macro examples:
* The following examples are typical macro usage for enabling/restricting access to header code based
* on the target runtime platform. The examples assume a correct setting of the WINAPI_FAMILY macro.
*
* App programs:
* Explicitly set WINAPI_FAMILY to WINAPI_PARTITION_APP (cannot access DESKTOP partition)
* Desktop programs:
* Leave WINAPI_FAMILY set to the default above (currently WINAPI_FAMILY_DESKTOP_APP)
*
* Note: Other families and partitions may be added in the future.
*
*
* The WINAPI_FAMILY_PARTITION macro:
* Code-block is available to programs that have access to specified partition.
*
* Example: Available to App and Desktop programs
* #if WINAPI_FAMILY_PARTITION( WINAPI_PARTITION_APP )
*
* Example: Available to Desktop programs
* #if WINAPI_FAMILY_PARTITION( WINAPI_PARTITION_DESKTOP )
*
*
* The WINAPI_FAMILY_ONE_PARTITION macro:
* Code-block is available to programs that have access to specified parition, but not others in the partition set.
*
* Example: Available only to App programs
* #if WINAPI_FAMILY_ONE_PARTITION( WINAPI_FAMILY, WINAPI_PARTITION_APP )
*
* Example: Available only to Desktop programs
* #if WINAPI_FAMILY_ONE_PARTITION( WINAPI_FAMILY, WINAPI_PARTITION_DESKTOP )
*
* Example: Available to App, but not Desktop programs
* #if WINAPI_FAMILY_ONE_PARTITION( WINAPI_FAMILY_DESKTOP_APP, WINAPI_PARTITION_APP )
*/
#endif /* !_INC_WINAPIFAMILY */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment