Added an unknown VxD error code.
[wine] / dlls / ttydrv / ttydrv_main.c
1 /*
2  * TTYDRV initialization code
3  */
4
5 #include "config.h"
6
7 #include <stdio.h>
8
9 #include "winbase.h"
10 #include "wine/winbase16.h"
11 #include "gdi.h"
12 #include "message.h"
13 #include "user.h"
14 #include "win.h"
15 #include "debugtools.h"
16 #include "ttydrv.h"
17
18 DEFAULT_DEBUG_CHANNEL(ttydrv);
19
20 int cell_width = 8;
21 int cell_height = 8;
22 int screen_rows = 50;  /* default value */
23 int screen_cols = 80;  /* default value */
24 WINDOW *root_window;
25
26
27 /***********************************************************************
28  *           TTYDRV process initialisation routine
29  */
30 static void process_attach(void)
31 {
32     WND_Driver       = &TTYDRV_WND_Driver;
33
34 #ifdef WINE_CURSES
35     if ((root_window = initscr()))
36     {
37         werase(root_window);
38         wrefresh(root_window);
39     }
40     getmaxyx(root_window, screen_rows, screen_cols);
41 #endif  /* WINE_CURSES */
42
43     TTYDRV_GDI_Initialize();
44
45     /* load display.dll */
46     LoadLibrary16( "display" );
47 }
48
49
50 /***********************************************************************
51  *           TTYDRV process termination routine
52  */
53 static void process_detach(void)
54 {
55     TTYDRV_GDI_Finalize();
56
57 #ifdef WINE_CURSES
58     if (root_window) endwin();
59 #endif  /* WINE_CURSES */
60
61     WND_Driver       = NULL;
62 }
63
64
65 /***********************************************************************
66  *           TTYDRV initialisation routine
67  */
68 BOOL WINAPI TTYDRV_Init( HINSTANCE hinst, DWORD reason, LPVOID reserved )
69 {
70     switch(reason)
71     {
72     case DLL_PROCESS_ATTACH:
73         process_attach();
74         break;
75
76     case DLL_PROCESS_DETACH:
77         process_detach();
78         break;
79     }
80     return TRUE;
81 }