Wrap ConnectNamedPipe

This commit is contained in:
Kovid Goyal 2020-10-15 19:24:16 +05:30
parent 812ceb2247
commit 175bb827f0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -705,6 +705,14 @@ create_named_pipe(PyObject *self, PyObject *args) {
return (PyObject*)Handle_create(h, NormalHandle, PyTuple_GET_ITEM(args, 0));
}
static PyObject *
connect_named_pipe(PyObject *self, PyObject *args) {
HANDLE handle;
if (!PyArg_ParseTuple(args, "O&", convert_handle, &handle)) return NULL;
if (!ConnectNamedPipe(handle, NULL)) return set_error_from_handle(args);
Py_RETURN_NONE;
}
static PyObject *
set_handle_information(PyObject *self, PyObject *args) {
unsigned long mask, flags;
@ -981,6 +989,7 @@ static PyMethodDef winutil_methods[] = {
M(create_mutex, METH_VARARGS),
M(get_async_key_state, METH_VARARGS),
M(create_named_pipe, METH_VARARGS),
M(connect_named_pipe, METH_VARARGS),
M(set_handle_information, METH_VARARGS),
M(get_long_path_name, METH_VARARGS),
M(get_process_times, METH_O),