Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
d5e4667b
Commit
d5e4667b
authored
May 15, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32: revector system_Init() a bit
parent
1ed466fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
35 deletions
+25
-35
src/win32/specific.c
src/win32/specific.c
+25
-35
No files found.
src/win32/specific.c
View file @
d5e4667b
...
@@ -39,43 +39,32 @@
...
@@ -39,43 +39,32 @@
#include <winsock.h>
#include <winsock.h>
/*****************************************************************************
* system_Init: initialize winsock and misc other things.
*****************************************************************************/
void
system_Init
(
void
)
{
WSADATA
Data
;
#if !defined( UNDER_CE
)
static
int
system_InitWSA
(
int
hi
,
int
lo
)
timeBeginPeriod
(
5
);
{
#endif
WSADATA
data
;
/* WinSock Library Init. */
if
(
WSAStartup
(
MAKEWORD
(
hi
,
lo
),
&
data
)
==
0
)
if
(
!
WSAStartup
(
MAKEWORD
(
2
,
2
),
&
Data
)
)
{
{
/* Aah, pretty useless check, we should always have Winsock 2.2
if
(
LOBYTE
(
data
.
wVersion
)
==
2
&&
HIBYTE
(
data
.
wVersion
)
==
2
)
* since it appeared in Win98. */
return
0
;
if
(
LOBYTE
(
Data
.
wVersion
)
!=
2
||
HIBYTE
(
Data
.
wVersion
)
!=
2
)
/* Winsock DLL is not usable */
/* We could not find a suitable WinSock DLL. */
WSACleanup
(
);
WSACleanup
(
);
else
/* Everything went ok. */
return
;
}
}
return
-
1
;
}
/* Let's try with WinSock 1.1 */
/**
if
(
!
WSAStartup
(
MAKEWORD
(
1
,
1
),
&
Data
)
)
* Initializes MME timer, Winsock.
{
*/
/* Confirm that the WinSock DLL supports 1.1.*/
void
system_Init
(
void
)
if
(
LOBYTE
(
Data
.
wVersion
)
!=
1
||
HIBYTE
(
Data
.
wVersion
)
!=
1
)
{
/* We could not find a suitable WinSock DLL. */
#if !defined( UNDER_CE )
WSACleanup
(
);
timeBeginPeriod
(
5
);
else
#endif
/* Everything went ok. */
return
;
}
fprintf
(
stderr
,
"error: can't initialize WinSocks
\n
"
);
if
(
system_InitWSA
(
2
,
2
)
&&
system_InitWSA
(
1
,
1
))
fputs
(
"Error: cannot initialize Winsocks
\n
"
,
stderr
);
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -327,10 +316,10 @@ LRESULT CALLBACK WMCOPYWNDPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
...
@@ -327,10 +316,10 @@ LRESULT CALLBACK WMCOPYWNDPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
return
DefWindowProc
(
hwnd
,
uMsg
,
wParam
,
lParam
);
return
DefWindowProc
(
hwnd
,
uMsg
,
wParam
,
lParam
);
}
}
/**
***************************************************************************
/**
*
system_End: terminate winsock
.
*
Cleans up after system_Init() and system_Configure()
.
*
****************************************************************************
/
*/
void
system_End
(
void
)
void
system_End
(
void
)
{
{
HWND
ipcwindow
;
HWND
ipcwindow
;
...
@@ -349,5 +338,6 @@ void system_End( void )
...
@@ -349,5 +338,6 @@ void system_End( void )
timeEndPeriod
(
5
);
timeEndPeriod
(
5
);
#endif
#endif
/* XXX: In theory, we should not call this if WSAStartup() failed. */
WSACleanup
();
WSACleanup
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment