| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -425,19 +425,6 @@ static PyType_Spec pyhkey_type_spec = { | |||
| 425 | 425 | /************************************************************************ | |
| 426 | 426 | The public PyHKEY API (well, not public yet :-) | |
| 427 | 427 | ************************************************************************/ | |
| 428 | - PyObject * | ||
| 429 | - PyHKEY_New(PyObject *m, HKEY hInit) | ||
| 430 | - { | ||
| 431 | - winreg_state *st = _PyModule_GetState(m); | ||
| 432 | - PyHKEYObject *key = PyObject_GC_New(PyHKEYObject, st->PyHKEY_Type); | ||
| 433 | - if (key == NULL) { | ||
| 434 | - return NULL; | ||
| 435 | - } | ||
| 436 | - key->hkey = hInit; | ||
| 437 | - PyObject_GC_Track(key); | ||
| 438 | - return (PyObject *)key; | ||
| 439 | - } | ||
| 440 | - | ||
| 441 | 428 | BOOL | |
| 442 | 429 | PyHKEY_Close(winreg_state *st, PyObject *ob_handle) | |
| 443 | 430 | { | |
@@ -513,48 +500,6 @@ PyHKEY_FromHKEY(winreg_state *st, HKEY h) | |||
| 513 | 500 | } | |
| 514 | 501 | ||
| 515 | 502 | ||
| 516 | - /************************************************************************ | ||
| 517 | - The module methods | ||
| 518 | - ************************************************************************/ | ||
| 519 | - BOOL | ||
| 520 | - PyWinObject_CloseHKEY(winreg_state *st, PyObject *obHandle) | ||
| 521 | - { | ||
| 522 | - BOOL ok; | ||
| 523 | - if (PyHKEY_Check(st, obHandle)) { | ||
| 524 | - ok = PyHKEY_Close(st, obHandle); | ||
| 525 | - } | ||
| 526 | - #if SIZEOF_LONG >= SIZEOF_HKEY | ||
| 527 | - else if (PyLong_Check(obHandle)) { | ||
| 528 | - long rc; | ||
| 529 | - Py_BEGIN_ALLOW_THREADS | ||
| 530 | - rc = RegCloseKey((HKEY)PyLong_AsLong(obHandle)); | ||
| 531 | - Py_END_ALLOW_THREADS | ||
| 532 | - ok = (rc == ERROR_SUCCESS); | ||
| 533 | - if (!ok) | ||
| 534 | - PyErr_SetFromWindowsErrWithFunction(rc, "RegCloseKey"); | ||
| 535 | - } | ||
| 536 | - #else | ||
| 537 | - else if (PyLong_Check(obHandle)) { | ||
| 538 | - long rc; | ||
| 539 | - HKEY hkey = (HKEY)PyLong_AsVoidPtr(obHandle); | ||
| 540 | - Py_BEGIN_ALLOW_THREADS | ||
| 541 | - rc = RegCloseKey(hkey); | ||
| 542 | - Py_END_ALLOW_THREADS | ||
| 543 | - ok = (rc == ERROR_SUCCESS); | ||
| 544 | - if (!ok) | ||
| 545 | - PyErr_SetFromWindowsErrWithFunction(rc, "RegCloseKey"); | ||
| 546 | - } | ||
| 547 | - #endif | ||
| 548 | - else { | ||
| 549 | - PyErr_SetString( | ||
| 550 | - PyExc_TypeError, | ||
| 551 | - "A handle must be a HKEY object or an integer"); | ||
| 552 | - return FALSE; | ||
| 553 | - } | ||
| 554 | - return ok; | ||
| 555 | - } | ||
| 556 | - | ||
| 557 | - | ||
| 558 | 503 | /* | |
| 559 | 504 | Private Helper functions for the registry interfaces | |
| 560 | 505 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments