How to use anonymous pipes in windows api (and pas

2019-06-11 03:16发布

问题:

I need to be able to pass int value representing fd (pipe fd) to gtk function as a first parameter

gint gdk_input_add gint source,
         GdkInputCondition condition,
         GdkInputFunction function,
                       gpointer data);

How do I do that, as CreatePipe returns HANDLE which is NOT int?

Thanks

回答1:

To convert a HANDLE value to a C file descriptor, call _open_osfhandle.