Skip to content

Commit bd7f661

Browse files
committed
---
yaml --- r: 135232 b: refs/heads/snap-stage3 c: 3b3d702 h: refs/heads/master v: v3
1 parent 6f18fc2 commit bd7f661

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 74090504219e4e37c1a6d9fdd8600f44b51c7b04
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: a52eaaa996a7edeb699a756f755ad4b8c23dc9df
4+
refs/heads/snap-stage3: 3b3d7021e4a2bccace8816bb24eec33eac09c9f2
55
refs/heads/try: 14378ea357c06c23607ca61ade44f60a7a64a1c7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
extern crate libc;
2+
use libc::{c_void, LPVOID, DWORD};
3+
use libc::types::os::arch::extra::LPWSTR;
4+
5+
extern "system" {
6+
fn FormatMessageW(flags: DWORD,
7+
lpSrc: LPVOID,
8+
msgId: DWORD,
9+
langId: DWORD,
10+
buf: LPWSTR,
11+
nsize: DWORD,
12+
args: *const c_void)
13+
-> DWORD;
14+
}
15+
16+
fn test() {
17+
let mut buf: [u16, ..50] = [0, ..50];
18+
let ret = unsafe {
19+
FormatMessageW(0x1000, 0 as *mut c_void, 1, 0x400,
20+
buf.as_mut_ptr(), buf.len() as u32, 0 as *const c_void)
21+
};
22+
// On some 32-bit Windowses (Win7-8 at least) this will fail with segmented
23+
// stacks taking control of pvArbitrary
24+
assert!(ret != 0);
25+
}
26+
fn main() {
27+
test()
28+
}

0 commit comments

Comments
 (0)