* exceptions.cc (open_stackdumpfile): Add comments.
This commit is contained in:
parent
6965e46961
commit
5003a3d1c5
@ -1,3 +1,7 @@
|
|||||||
|
2008-02-28 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* exceptions.cc (open_stackdumpfile): Add comments.
|
||||||
|
|
||||||
2008-02-28 Corinna Vinschen <corinna@vinschen.de>
|
2008-02-28 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* exceptions.cc (open_stackdumpfile): Use NtCreateFile to create
|
* exceptions.cc (open_stackdumpfile): Use NtCreateFile to create
|
||||||
|
@ -145,18 +145,21 @@ open_stackdumpfile ()
|
|||||||
WCHAR corefile[strlen (p) + sizeof (".stackdump")];
|
WCHAR corefile[strlen (p) + sizeof (".stackdump")];
|
||||||
UNICODE_STRING ucore;
|
UNICODE_STRING ucore;
|
||||||
OBJECT_ATTRIBUTES attr;
|
OBJECT_ATTRIBUTES attr;
|
||||||
|
/* Create the UNICODE variation of <progname>.stackdump. */
|
||||||
RtlInitEmptyUnicodeString (&ucore, corefile,
|
RtlInitEmptyUnicodeString (&ucore, corefile,
|
||||||
sizeof corefile - sizeof (WCHAR));
|
sizeof corefile - sizeof (WCHAR));
|
||||||
ucore.Length = sys_mbstowcs (ucore.Buffer,
|
ucore.Length = sys_mbstowcs (ucore.Buffer,
|
||||||
ucore.MaximumLength / sizeof (WCHAR),
|
ucore.MaximumLength / sizeof (WCHAR),
|
||||||
p, strlen (p)) * sizeof (WCHAR);
|
p, strlen (p)) * sizeof (WCHAR);
|
||||||
RtlAppendUnicodeToString (&ucore, L".stackdump");
|
RtlAppendUnicodeToString (&ucore, L".stackdump");
|
||||||
|
/* Create an object attribute which refers to <progname>.stackdump
|
||||||
|
in Cygwin's cwd. */
|
||||||
InitializeObjectAttributes (&attr, &ucore, OBJ_CASE_INSENSITIVE,
|
InitializeObjectAttributes (&attr, &ucore, OBJ_CASE_INSENSITIVE,
|
||||||
cygheap->cwd.get_handle (), NULL);
|
cygheap->cwd.get_handle (), NULL);
|
||||||
HANDLE h;
|
HANDLE h;
|
||||||
IO_STATUS_BLOCK io;
|
IO_STATUS_BLOCK io;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
/* Try to open it to dump the stack in it. */
|
||||||
status = NtCreateFile (&h, GENERIC_WRITE | SYNCHRONIZE, &attr, &io,
|
status = NtCreateFile (&h, GENERIC_WRITE | SYNCHRONIZE, &attr, &io,
|
||||||
NULL, FILE_ATTRIBUTE_NORMAL, 0, FILE_OVERWRITE_IF,
|
NULL, FILE_ATTRIBUTE_NORMAL, 0, FILE_OVERWRITE_IF,
|
||||||
FILE_SYNCHRONOUS_IO_NONALERT
|
FILE_SYNCHRONOUS_IO_NONALERT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user