Author: nyadav
Date: Fri May 27 08:50:55 2011
New Revision: 51949
URL:
http://svn.reactos.org/svn/reactos?rev=51949&view=rev
Log:
Audio Server API with RPC
Modified:
branches/nyadav-audio-branch/dll/win32/audiosrv2/CMakeLists.txt
branches/nyadav-audio-branch/dll/win32/audiosrv2/dllmain.c
Modified: branches/nyadav-audio-branch/dll/win32/audiosrv2/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/nyadav-audio-branch/dll/win32/a…
==============================================================================
--- branches/nyadav-audio-branch/dll/win32/audiosrv2/CMakeLists.txt [iso-8859-1]
(original)
+++ branches/nyadav-audio-branch/dll/win32/audiosrv2/CMakeLists.txt [iso-8859-1] Fri May
27 08:50:55 2011
@@ -1,16 +1,20 @@
+include_directories(${REACTOS_BINARY_DIR}/include/reactos/idl)
+include_directories(${REACTOS_SOURCE_DIR}/include/reactos/libs/audsrv)
-include_directories(${REACTOS_SOURCE_DIR}/include/reactos/libs/audiosrv2)
-
-spec2def(audiosrv2dll.dll audiosrv2dll.spec)
+spec2def(audsrvapi.dll audsrvapi.spec)
list(APPEND SOURCE
dllmain.c
- ${CMAKE_CURRENT_BINARY_DIR}/audiosrv2dll.def)
+ ${CMAKE_CURRENT_BINARY_DIR}/audsrvapi.def)
-add_library(audiosrv2dll SHARED ${SOURCE})
-set_module_type(audiosrv2dll win32dll)
+add_library(audsrvapi SHARED ${SOURCE})
+set_module_type(audsrvapi win32dll)
-target_link_libraries(audiosrv2dll uuid wine)
-add_importlibs(audiosrv2dll ole32 oleaut32 user32 advapi32 msvcrt kernel32 ntdll)
-add_cab_target(audiosrv2dll 1)
-add_importlib_target(audiosrv2dll.spec)
+target_link_libraries(audsrvapi audsrvrpc uuid wine ${PSEH_LIB})
+
+
+add_pch(audsrv ${CMAKE_CURRENT_SOURCE_DIR}/audsrv.h ${SOURCE})
+
+add_importlibs(audsrvapi rpcrt4 ole32 oleaut32 user32 advapi32 msvcrt kernel32 ntdll)
+add_cab_target(audsrvapi 1)
+add_importlib_target(audsrvapi.spec)
Modified: branches/nyadav-audio-branch/dll/win32/audiosrv2/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/branches/nyadav-audio-branch/dll/win32/a…
==============================================================================
--- branches/nyadav-audio-branch/dll/win32/audiosrv2/dllmain.c [iso-8859-1] (original)
+++ branches/nyadav-audio-branch/dll/win32/audiosrv2/dllmain.c [iso-8859-1] Fri May 27
08:50:55 2011
@@ -1,68 +1,18 @@
-#include <audiosrv.h>
-
-static MixerEngine * lpvMem = NULL;
-static HANDLE hMapObject = NULL;
+#include "audsrv.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
-BOOL fInit, fIgnore;
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
- hMapObject = CreateFileMapping(
- INVALID_HANDLE_VALUE, // use paging file
- NULL, // default security attributes
- PAGE_READWRITE, // read/write access
- 0, // size: high 32-bits
- sizeof(MixerEngine),TEXT("MixerEngine")); // size:
low 32-bits
- if (hMapObject == NULL)
- return FALSE;
-
- fInit = (GetLastError() != ERROR_ALREADY_EXISTS);
-
- lpvMem = (MixerEngine *)MapViewOfFile(
- hMapObject, // object to map view of
- FILE_MAP_WRITE, // read/write access
- 0, // high offset: map from
- 0, // low offset: beginning
- 0); // default: map entire file
- if (lpvMem == NULL)
- return FALSE;
-
- if (fInit)
- lpvMem->dead=0;
- lpvMem->masterchannels=0;
- lpvMem->masterbitspersample=0;
- lpvMem->masterchannelmask=0;
- lpvMem->masterdoublebuf[0]=NULL;
- lpvMem->masterdoublebuf[1]=NULL;
- lpvMem->masterfreq=0;
- lpvMem->mastervolume=0;
- lpvMem->mute=0;
- lpvMem->portstream=NULL;
- lpvMem->workingbuffer=0;
- lpvMem->mixerthread=NULL;
- lpvMem->playerthread=NULL;
- lpvMem->EventPool[0]=CreateEvent(NULL,FALSE,FALSE,NULL);
- lpvMem->EventPool[1]=CreateEvent(NULL,FALSE,FALSE,NULL);
-
- break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
- break;
case DLL_PROCESS_DETACH:
- fIgnore = UnmapViewOfFile(lpvMem);
- fIgnore = CloseHandle(hMapObject);
break;
}
return TRUE;
}
-
-WINAPI MixerEngine * getmixerengine()
-{
-return lpvMem;
-}