1 /*****************************************************************************
2 * win32_specific.c: Win32 specific features
3 *****************************************************************************
4 * Copyright (C) 2001 VideoLAN
5 * $Id: win32_specific.c,v 1.18 2002/11/08 10:26:53 gbazin Exp $
7 * Authors: Samuel Hocevar <sam@zoy.org>
8 * Gildas Bazin <gbazin@netcourrier.com>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 *****************************************************************************/
24 #include <errno.h> /* ENOMEM */
25 #include <string.h> /* strdup() */
26 #include <stdlib.h> /* free() */
33 /*****************************************************************************
34 * system_Init: initialize winsock and misc other things.
35 *****************************************************************************/
36 void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] )
41 /* WinSock Library Init. */
42 i_err = WSAStartup( MAKEWORD( 1, 1 ), &Data );
46 fprintf( stderr, "error: can't initiate WinSocks, error %i\n", i_err );
49 /* Set the default file-translation mode */
53 /*****************************************************************************
54 * system_Configure: check for system specific configuration options.
55 *****************************************************************************/
56 void system_Configure( vlc_t *p_this )
58 p_this->p_libvlc->b_fast_mutex = config_GetInt( p_this, "fast-mutex" );
59 p_this->p_libvlc->i_win9x_cv = config_GetInt( p_this, "win9x-cv-method" );
61 /* Raise default priority of the current process */
62 #ifndef ABOVE_NORMAL_PRIORITY_CLASS
63 # define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
65 if( !SetPriorityClass( GetCurrentProcess(),
66 ABOVE_NORMAL_PRIORITY_CLASS ) )
68 if( !SetPriorityClass( GetCurrentProcess(),
69 HIGH_PRIORITY_CLASS ) )
70 msg_Dbg( p_this, "can't raise process priority" );
72 msg_Dbg( p_this, "raised process priority" );
75 msg_Dbg( p_this, "raised process priority" );
78 /*****************************************************************************
79 * system_End: terminate winsock.
80 *****************************************************************************/
81 void system_End( vlc_t *p_this )