1:08:50 If you're making a safe wrapper for c/c++ library bindings you should abstract away from using c types. I believe it'd be more idiomatic to pass in a regular String and convert it to what you need inside of the new method so the user doesn't have to think about using types that they aren't used to.
A few things I noticed: - 0 being equivalent to NULL is not a Windows thing, but a C++ thing. NULL was *required* to be defined as 0 (unlike C which *may* also define NULL as (void*)0) until C++11 which introduces nullptr, which has the advantage of disallowing silently interpreting 0 as a null pointer. Also helps in avoiding calling the wrong overload. - HRESULT can be non-zero but successful. Only negative HRESULT values indicate failure, which is why the C++ code used the SUCCEEDED macro. - For string constants you can use std::ffi::CStr::from_bytes_with_nul to avoid an allocation just to add a null byte (albeit requiring you to explicitly pass a \0-terminated byte-string)
I'm pretty sure that the Win32 Sleep() call waits in milliseconds, not seconds. That's why there was such a delay between you hitting the brake and the event triggering.
The name pointer is dangling after SimConnect::new(). I haven't been able to find any documentation on the required lifetime of the pointer, so I can't say for sure, but this definitely smells of unsoundness.
I also couldn't find any docs on the expected lifetime of this pointer but it _seems_ like MapClientEventToSimEvent does not assume the pointer lives longer than the function call.