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 @@
#include <winsock.h>
/*****************************************************************************
* system_Init: initialize winsock and misc other things.
*****************************************************************************/
void
system_Init
(
void
)
{
WSADATA
Data
;
#if !defined( UNDER_CE
)
timeBeginPeriod
(
5
);
#endif
static
int
system_InitWSA
(
int
hi
,
int
lo
)
{
WSADATA
data
;
/* WinSock Library Init. */
if
(
!
WSAStartup
(
MAKEWORD
(
2
,
2
),
&
Data
)
)
if
(
WSAStartup
(
MAKEWORD
(
hi
,
lo
),
&
data
)
==
0
)
{
/* Aah, pretty useless check, we should always have Winsock 2.2
* since it appeared in Win98. */
if
(
LOBYTE
(
Data
.
wVersion
)
!=
2
||
HIBYTE
(
Data
.
wVersion
)
!=
2
)
/* We could not find a suitable WinSock DLL. */
WSACleanup
(
);
else
/* Everything went ok. */
return
;
if
(
LOBYTE
(
data
.
wVersion
)
==
2
&&
HIBYTE
(
data
.
wVersion
)
==
2
)
return
0
;
/* Winsock DLL is not usable */
WSACleanup
(
);
}
return
-
1
;
}
/* Let's try with WinSock 1.1 */
if
(
!
WSAStartup
(
MAKEWORD
(
1
,
1
),
&
Data
)
)
{
/* Confirm that the WinSock DLL supports 1.1.*/
if
(
LOBYTE
(
Data
.
wVersion
)
!=
1
||
HIBYTE
(
Data
.
wVersion
)
!=
1
)
/* We could not find a suitable WinSock DLL. */
WSACleanup
(
);
else
/* Everything went ok. */
return
;
}
/**
* Initializes MME timer, Winsock.
*/
void
system_Init
(
void
)
{
#if !defined( UNDER_CE )
timeBeginPeriod
(
5
);
#endif
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,
return
DefWindowProc
(
hwnd
,
uMsg
,
wParam
,
lParam
);
}
/**
***************************************************************************
*
system_End: terminate winsock
.
*
****************************************************************************
/
void
system_End
(
void
)
/**
*
Cleans up after system_Init() and system_Configure()
.
*/
void
system_End
(
void
)
{
HWND
ipcwindow
;
...
...
@@ -349,5 +338,6 @@ void system_End( void )
timeEndPeriod
(
5
);
#endif
/* XXX: In theory, we should not call this if WSAStartup() failed. */
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