richedit: Modify ME_GetTextW() to honor CR and LF encodings.
[wine] / dlls / dmloader / dmloader_main.c
1 /* DirectMusicLoader Main
2  *
3  * Copyright (C) 2003-2004 Rok Mandeljc
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18  */
19
20 #include "dmloader_private.h"
21
22 WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
23
24 LONG dwDirectMusicContainer = 0;
25 LONG dwDirectMusicLoader = 0;
26
27 /******************************************************************
28  *              DllMain
29  */
30 BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
31         if (fdwReason == DLL_PROCESS_ATTACH) {
32                 DisableThreadLibraryCalls(hinstDLL);
33                 /* FIXME: Initialisation */
34         } else if (fdwReason == DLL_PROCESS_DETACH) {
35                 /* FIXME: Cleanup */
36         }
37         return TRUE;
38 }
39
40
41 /******************************************************************
42  *              DllCanUnloadNow (DMLOADER.@)
43  */
44 HRESULT WINAPI DllCanUnloadNow (void)
45 {
46     TRACE("(void)\n");
47         /* if there are no instances left, it's safe to release */
48         if (!dwDirectMusicContainer && !dwDirectMusicLoader)
49                 return S_OK;
50         else
51         return S_FALSE;
52 }
53
54
55 /******************************************************************
56  *              DllGetClassObject (DMLOADER.@)
57  */
58 HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
59 {
60     TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
61     if (IsEqualCLSID (rclsid, &CLSID_DirectMusicLoader) && IsEqualIID (riid, &IID_IClassFactory)) {
62                 return DMUSIC_CreateDirectMusicLoaderCF (riid, ppv, NULL);
63         } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicContainer) && IsEqualIID (riid, &IID_IClassFactory)) {
64                 return DMUSIC_CreateDirectMusicContainerCF (riid, ppv, NULL);           
65         }
66         
67     WARN(": no class found\n");
68     return CLASS_E_CLASSNOTAVAILABLE;
69 }