Skip to content

Instantly share code, notes, and snippets.

@Jan200101
Last active January 15, 2024 17:15
Show Gist options
  • Save Jan200101/383ec594f8ca2b53df6afa5c7d04abb2 to your computer and use it in GitHub Desktop.
Save Jan200101/383ec594f8ca2b53df6afa5c7d04abb2 to your computer and use it in GitHub Desktop.
Test Program to verify the implicit behavior of DirectSoundCaptureCreate making use of winmm
#include <windows.h>
#include <cstdio>
#include <dsound.h>
typedef HRESULT(*tDirectSoundCaptureCreate)(LPCGUID lpcGUID, IDirectSoundCapture** ppDSC, IUnknown* pUnkOuter);
tDirectSoundCaptureCreate pDirectSoundCaptureCreate;
int main()
{
HMODULE hModule;
hModule = LoadLibraryA("dsound.dll");
if (!hModule)
{
fprintf(stderr, "Could not load dsound.dll");
return 1;
}
pDirectSoundCaptureCreate = (tDirectSoundCaptureCreate)GetProcAddress(hModule, "DirectSoundCaptureCreate");
if (!pDirectSoundCaptureCreate)
{
fprintf(stderr, "Could not find DirectSoundCaptureCreate");
return 1;
}
LPDIRECTSOUNDCAPTURE capture;
pDirectSoundCaptureCreate(NULL, &capture, NULL);
fprintf(stderr, "DirectSoundCaptureCreate called, sleeping...");
while (1)
{
Sleep(1 * 60 * 60 * 1000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment