Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COM Helpers and Various Constants #100

Merged
merged 4 commits into from
May 23, 2015
Merged

COM Helpers and Various Constants #100

merged 4 commits into from
May 23, 2015

Conversation

randomPoison
Copy link
Contributor

  • Adds the RIDL declarations for IMMDevice, IMMDeviceEnumerator, IAudioClient, and IAudioRenderClient.
  • Adds SetPriorityClass() to kernel32-sys.
  • Adds timeBeginPeriod() and timeEndPeriod() to winmm-sys.
  • Adds various constants related to core audio, timers, and thread priorities.

I left the RIDL declarations in the main winapi lib file, but if you want them each in a separate file like you did with unknownbase.rs then I can move them over.

@retep998
Copy link
Owner

As issue #17 states, everything is being split out of lib.rs into separate files for each header.

pub QueryInterface: unsafe extern "system" fn(
This: *mut IMMDevice,
RIDL!(
interface IMMDevice(IMMDeviceVtbl) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change the COM definitions to also inherit from their base COM classes, like the way I did with AsyncIUnknown?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, it's taken care of.

@randomPoison
Copy link
Contributor Author

I moved all the things I added or changed into the appropriate modules.

@@ -2,6 +2,8 @@
// Licensed under the MIT License <LICENSE.md>
//! this ALWAYS GENERATED file contains the definitions for the interfaces
//1627
use unknwnbase::*;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer not to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I try to do ::IUnknown the RIDL macro doesn't compile, so I need to import the type manually. Would it be better to change the macro so that it supports absolute paths?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to fix the macro.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed now.

@retep998
Copy link
Owner

Thanks, could you rebase everything and maybe squash it a bit?

- Adds the WAVE_FORMAT_* constants form mmreg.h.
- Adds more COM helper functions to IMMDevice, IAudioClient, and IAudioRenderClient. (+2 squashed commit)

Squashed commit:

[2d1d204] IMMDeviceEnumerator Helpers

- Adds and implementation for IMMDeviceEnumerator with helper methods to call the functions in its vtable.
- Adds the COINIT_* constants.

[1b9bcb6] System Timer Resolution Methods

- Adds timeBeginPeriod() and timeEndPeriod() ot winmm.
- Adds SetPriorityClass() to kernel32-sys.
- Adds a mess of constants from winbase.h.
- Changes the existing RILD declarations to inherit from IUnknown rather than re-declaring the interface for each one.

Convert Manual COM Declarations to RIDL

Convert Manual COM Declarations to RIDL
Move Constants and Types Into Separate Modules
- Changes the RIDL! macro to qualify the parent type with the absolute path so that the type doesn't need to be imported with a use statement.
@randomPoison
Copy link
Contributor Author

Rebased and squashed. Let me know if it looks like I did anything wrong, I don't normally rebase/squash in my projects so I wasn't familiar with the process.

@retep998 retep998 merged commit 4f377c5 into retep998:master May 23, 2015
@randomPoison randomPoison deleted the com_helpers branch October 17, 2015 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants