There are 5 winapi families:
WINAPI_FAMILY_PC_APPWINAPI_FAMILY_PHONE_APPWINAPI_FAMILY_SYSTEMWINAPI_FAMILY_SERVERWINAPI_FAMILY_DESKTOP_APP
- A crate that depends on
winapishould specify the set of winapi families that it supports.
| use std::io::Read; | |
| use std::net::TcpStream; | |
| use std::sync::atomic::{ ATOMIC_USIZE_INIT, AtomicUsize, Ordering }; | |
| use std::thread::{spawn, sleep}; | |
| use std::time::Duration; | |
| static COUNTER: AtomicUsize = ATOMIC_USIZE_INIT; | |
| const NUM_SOCKETS: u32 = 10_000; |
| #include <iostream> | |
| using namespace std; | |
| extern "C" { | |
| void bar() { | |
| cout << "C++ throwing an exception" << endl; | |
| throw 273; | |
| } | |
| void foo(); | |
| } |
| #include <iostream> | |
| using namespace std; | |
| struct Bar { | |
| ~Bar() { | |
| cout << "C++ destructor is firing" << endl; | |
| } | |
| }; | |
| extern "C" { |
There are 5 winapi families:
WINAPI_FAMILY_PC_APPWINAPI_FAMILY_PHONE_APPWINAPI_FAMILY_SYSTEMWINAPI_FAMILY_SERVERWINAPI_FAMILY_DESKTOP_APPwinapi should specify the set of winapi families that it supports.| Microsoft (R) COFF/PE Dumper Version 14.00.24215.1 | |
| Copyright (C) Microsoft Corporation. All rights reserved. | |
| Dump of file cdylib gnu.dll | |
| File Type: DLL | |
| Section contains the following exports for cdylib.dll |
Need to be able to add dynamically sized arrays as the last field of a type.
#[repr(C)] struct Foo {
blah: Blah,
cbSize: DWORD,
array: [SomeType; N], // This field should be dynamically sized.
}The user must be able to specify a value for N when creating such a type, but there must only be one such type, so that FFI functions can easily take a *const Foo or *mut Foo.
| Name | Size |
|---|---|
std__panicking__default_hook____closure__ |
000025E4 |
std__panicking__rust_panic_with_hook |
00000E60 |
main |
000008FB |
std__io__Write__write_fmt____impl____write_str_std__io__stdio__StdoutLock_ |
000008C5 |
core__fmt__Formatter__pad_integral |
000005B4 |
std__io__error____impl____fmt |
0000056C |
core__fmt____impl____fmt_0 |
00000438 |
core__fmt__Formatter__pad |
00000437 |
| > cargo rustc --features everything -- -Ztime-passes | |
| Compiling winapi v0.3.0-alpha.0 (file:///C:/Users/Peter/Code/winapi-rs) | |
| time: 0.469; rss: 66MB parsing | |
| time: 0.000; rss: 66MB recursion limit | |
| time: 0.000; rss: 66MB crate injection | |
| time: 0.000; rss: 66MB plugin loading | |
| time: 0.000; rss: 66MB plugin registration | |
| time: 1.858; rss: 140MB expansion | |
| time: 0.000; rss: 140MB maybe building test harness | |
| time: 0.023; rss: 140MB maybe creating a macro crate |
| [package] | |
| name = "handletest" | |
| version = "0.1.0" | |
| authors = ["Peter Atashian <[email protected]>"] | |
| [dependencies.winapi] | |
| git = "https://github.com/retep998/winapi-rs" | |
| branch = "dev" | |
| features = ["minwinbase", "minwindef", "processthreadsapi", "winbase", "winnt"] |
| [package] | |
| name = "masstest" | |
| version = "0.1.0" | |
| authors = ["Peter"] | |
| [profile.release] | |
| lto = true | |
| [dependencies] | |
| advapi32-sys = "0.2.0" |