Last active
January 15, 2024 17:15
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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