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
85a61b6d
Commit
85a61b6d
authored
Aug 03, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GetWindowsError: use FromWide()
parent
1e7cd2c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
29 deletions
+9
-29
src/modules/os.c
src/modules/os.c
+9
-29
No files found.
src/modules/os.c
View file @
85a61b6d
...
...
@@ -291,43 +291,23 @@ static void *module_Lookup( module_handle_t handle, const char *psz_function )
}
#if defined(HAVE_DL_WINDOWS)
# include <wchar.h>
static
char
*
GetWindowsError
(
void
)
{
#if defined(UNDER_CE)
wchar_t
psz_tmp
[
MAX_PATH
];
char
*
psz_buffer
=
malloc
(
MAX_PATH
);
#else
char
*
psz_tmp
=
malloc
(
MAX_PATH
);
#endif
wchar_t
wmsg
[
256
];
int
i
=
0
,
i_error
=
GetLastError
();
FormatMessage
(
FORMAT_MESSAGE_FROM_SYSTEM
|
FORMAT_MESSAGE_IGNORE_INSERTS
,
NULL
,
i_error
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
),
(
LPTSTR
)
psz_tmp
,
MAX_PATH
,
NULL
);
FormatMessage
W
(
FORMAT_MESSAGE_FROM_SYSTEM
|
FORMAT_MESSAGE_IGNORE_INSERTS
,
NULL
,
i_error
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
),
wmsg
,
256
,
NULL
);
/* Go to the end of the string */
while
(
psz_tmp
[
i
]
&&
psz_tmp
[
i
]
!=
_T
(
'\r'
)
&&
psz_tmp
[
i
]
!=
_T
(
'\n'
)
)
{
while
(
!
wmemchr
(
L"
\r\n\0
"
,
wmsg
[
i
],
3
)
)
i
++
;
}
if
(
psz_tmp
[
i
]
)
{
#if defined(UNDER_CE)
swprintf
(
psz_tmp
+
i
,
L" (error %i)"
,
i_error
);
psz_tmp
[
255
]
=
L'\0'
;
#else
snprintf
(
psz_tmp
+
i
,
256
-
i
,
" (error %i)"
,
i_error
);
psz_tmp
[
255
]
=
'\0'
;
#endif
}
#if defined(UNDER_CE)
wcstombs
(
psz_buffer
,
psz_tmp
,
MAX_PATH
);
return
psz_buffer
;
#else
return
psz_tmp
;
#endif
snwprintf
(
wmsg
+
i
,
256
-
i
,
L" (error %i)"
,
i_error
);
return
FromWide
(
wmsg
);
}
#endif
/* HAVE_DL_WINDOWS */
#endif
/* HAVE_DYNAMIC_PLUGINS */
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