2 * Copyright 2001 Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include "wine/debug.h"
29 #include "avifile_private.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(avifile);
33 WINE_AVIFILE_DATA AVIFILE_data;
36 /***********************************************************************
37 * AVIFILE_InitProcess (internal)
39 static BOOL AVIFILE_InitProcess( void )
43 AVIFILE_data.dwAVIFileRef = 0;
44 AVIFILE_data.dwClassObjRef = 0;
45 AVIFILE_data.hHeap = (HANDLE)NULL;
47 AVIFILE_data.hHeap = HeapCreate( 0, 0x10000, 0 );
48 if ( AVIFILE_data.hHeap == (HANDLE)NULL )
50 ERR( "cannot allocate heap for AVIFILE.\n" );
57 /***********************************************************************
58 * AVIFILE_UninitProcess (internal)
60 static void AVIFILE_UninitProcess( void )
64 if ( AVIFILE_data.dwAVIFileRef != 0 )
65 ERR( "you must call AVIFileExit()\n" );
67 if ( AVIFILE_data.dwClassObjRef != 0 )
68 ERR( "you must release some objects allocated from AVIFile.\n" );
70 if ( AVIFILE_data.hHeap != (HANDLE)NULL )
72 HeapDestroy( AVIFILE_data.hHeap );
73 AVIFILE_data.hHeap = (HANDLE)NULL;
77 /***********************************************************************
80 BOOL WINAPI AVIFILE_DllMain(
87 case DLL_PROCESS_ATTACH:
88 if ( !AVIFILE_InitProcess() )
91 case DLL_PROCESS_DETACH:
92 AVIFILE_UninitProcess();
94 case DLL_THREAD_ATTACH:
96 case DLL_THREAD_DETACH: