source: trunk/src/avifil32/main.c@ 6712

Last change on this file since 6712 was 6712, checked in by sandervl, 24 years ago

restored old version

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