1 | /* $Id: main.c,v 1.2 2001-09-05 14:16:45 bird Exp $ */
|
---|
2 | /*
|
---|
3 | * Copyright 2001 Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
|
---|
4 | */
|
---|
5 |
|
---|
6 | #include <string.h>
|
---|
7 | #include <stdio.h>
|
---|
8 | #include <assert.h>
|
---|
9 |
|
---|
10 | #include "winbase.h"
|
---|
11 | #include "winnls.h"
|
---|
12 | #include "mmsystem.h"
|
---|
13 | #include "winerror.h"
|
---|
14 | #include "vfw.h"
|
---|
15 | #include "debugtools.h"
|
---|
16 | #include "avifile_private.h"
|
---|
17 |
|
---|
18 | DEFAULT_DEBUG_CHANNEL(avifile);
|
---|
19 |
|
---|
20 | WINE_AVIFILE_DATA AVIFILE_data;
|
---|
21 |
|
---|
22 |
|
---|
23 | /***********************************************************************
|
---|
24 | * AVIFILE_InitProcess (internal)
|
---|
25 | */
|
---|
26 | static BOOL AVIFILE_InitProcess( void )
|
---|
27 | {
|
---|
28 | TRACE("()\n");
|
---|
29 |
|
---|
30 | AVIFILE_data.dwAVIFileRef = 0;
|
---|
31 | AVIFILE_data.dwClassObjRef = 0;
|
---|
32 | AVIFILE_data.hHeap = (HANDLE)NULL;
|
---|
33 |
|
---|
34 | AVIFILE_data.hHeap = HeapCreate( 0, 0x10000, 0 );
|
---|
35 | if ( AVIFILE_data.hHeap == (HANDLE)NULL )
|
---|
36 | {
|
---|
37 | ERR( "cannot allocate heap for AVIFILE.\n" );
|
---|
38 | return FALSE;
|
---|
39 | }
|
---|
40 |
|
---|
41 | return TRUE;
|
---|
42 | }
|
---|
43 |
|
---|
44 | /***********************************************************************
|
---|
45 | * AVIFILE_UninitProcess (internal)
|
---|
46 | */
|
---|
47 | static void AVIFILE_UninitProcess( void )
|
---|
48 | {
|
---|
49 | TRACE("()\n");
|
---|
50 |
|
---|
51 | if ( AVIFILE_data.dwAVIFileRef != 0 )
|
---|
52 | ERR( "you must call AVIFileExit()\n" );
|
---|
53 |
|
---|
54 | if ( AVIFILE_data.dwClassObjRef != 0 )
|
---|
55 | ERR( "you must release some objects allocated from AVIFile.\n" );
|
---|
56 |
|
---|
57 | if ( AVIFILE_data.hHeap != (HANDLE)NULL )
|
---|
58 | {
|
---|
59 | HeapDestroy( AVIFILE_data.hHeap );
|
---|
60 | AVIFILE_data.hHeap = (HANDLE)NULL;
|
---|
61 | }
|
---|
62 | }
|
---|
63 |
|
---|
64 | /***********************************************************************
|
---|
65 | * AVIFILE_DllMain
|
---|
66 | */
|
---|
67 | BOOL WINAPI AVIFILE_DllMain(
|
---|
68 | HINSTANCE hInstDLL,
|
---|
69 | DWORD fdwReason,
|
---|
70 | LPVOID lpvReserved )
|
---|
71 | {
|
---|
72 | switch ( fdwReason )
|
---|
73 | {
|
---|
74 | case DLL_PROCESS_ATTACH:
|
---|
75 | if ( !AVIFILE_InitProcess() )
|
---|
76 | return FALSE;
|
---|
77 | break;
|
---|
78 | case DLL_PROCESS_DETACH:
|
---|
79 | AVIFILE_UninitProcess();
|
---|
80 | break;
|
---|
81 | case DLL_THREAD_ATTACH:
|
---|
82 | break;
|
---|
83 | case DLL_THREAD_DETACH:
|
---|
84 | break;
|
---|
85 | }
|
---|
86 |
|
---|
87 | return TRUE;
|
---|
88 | }
|
---|
89 |
|
---|
90 |
|
---|