LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - py_windows_event_ids.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 38 39 97.4 %
Date: 2024-04-21 15:09:00 Functions: 1 1 100.0 %

          Line data    Source code
       1             : 
       2             : /* Python wrapper functions auto-generated by pidl */
       3             : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
       4             : #include "lib/replace/system/python.h"
       5             : #include "python/py3compat.h"
       6             : #include "includes.h"
       7             : #include "python/modules.h"
       8             : #include <pytalloc.h>
       9             : #include "librpc/rpc/pyrpc.h"
      10             : #include "librpc/rpc/pyrpc_util.h"
      11             : #include "bin/default/librpc/gen_ndr/ndr_windows_event_ids.h"
      12             : 
      13             : 
      14             : /*
      15             :  * Suppress compiler warnings if the generated code does not call these
      16             :  * functions
      17             :  */
      18             : #ifndef _MAYBE_UNUSED_
      19             : #ifdef __has_attribute
      20             : #if __has_attribute(unused)
      21             : #define _MAYBE_UNUSED_ __attribute__ ((unused))
      22             : #else
      23             : #define _MAYBE_UNUSED_
      24             : #endif
      25             : #endif
      26             : #endif
      27             : /*
      28             :  * These functions are here to ensure they can be optimized out by
      29             :  * the compiler based on the constant input values
      30             :  */
      31             : 
      32             : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
      33             : {
      34             :         switch (var_size) {
      35             :         case 8:
      36             :                 return UINT64_MAX;
      37             :         case 4:
      38             :                 return UINT32_MAX;
      39             :         case 2:
      40             :                 return UINT16_MAX;
      41             :         case 1:
      42             :                 return UINT8_MAX;
      43             :         }
      44             : 
      45             :         return 0;
      46             : }
      47             : 
      48             : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
      49             : {
      50             :         switch (var_size) {
      51             :         case 8:
      52             :                 return INT64_MAX;
      53             :         case 4:
      54             :                 return INT32_MAX;
      55             :         case 2:
      56             :                 return INT16_MAX;
      57             :         case 1:
      58             :                 return INT8_MAX;
      59             :         }
      60             : 
      61             :         return 0;
      62             : }
      63             : 
      64             : 
      65             : static PyMethodDef windows_event_ids_methods[] = {
      66             :         { NULL, NULL, 0, NULL }
      67             : };
      68             : 
      69             : static struct PyModuleDef moduledef = {
      70             :         PyModuleDef_HEAD_INIT,
      71             :         .m_name = "windows_event_ids",
      72             :         .m_doc = "windows_event_ids DCE/RPC",
      73             :         .m_size = -1,
      74             :         .m_methods = windows_event_ids_methods,
      75             : };
      76          18 : MODULE_INIT_FUNC(windows_event_ids)
      77             : {
      78          18 :         PyObject *m = NULL;
      79             : 
      80             : 
      81          18 :         m = PyModule_Create(&moduledef);
      82          18 :         if (m == NULL)
      83           0 :                 goto out;
      84             : 
      85          18 :         PyModule_AddObject(m, "EVT_ID_NONE", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_NONE)));
      86          18 :         PyModule_AddObject(m, "EVT_ID_SUCCESSFUL_LOGON", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_SUCCESSFUL_LOGON)));
      87          18 :         PyModule_AddObject(m, "EVT_ID_UNSUCCESSFUL_LOGON", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_UNSUCCESSFUL_LOGON)));
      88          18 :         PyModule_AddObject(m, "EVT_ID_PASSWORD_CHANGE", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_PASSWORD_CHANGE)));
      89          18 :         PyModule_AddObject(m, "EVT_ID_PASSWORD_RESET", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_PASSWORD_RESET)));
      90          18 :         PyModule_AddObject(m, "EVT_ID_USER_ADDED_TO_GLOBAL_SEC_GROUP", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_USER_ADDED_TO_GLOBAL_SEC_GROUP)));
      91          18 :         PyModule_AddObject(m, "EVT_ID_USER_REMOVED_FROM_GLOBAL_SEC_GROUP", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_USER_REMOVED_FROM_GLOBAL_SEC_GROUP)));
      92          18 :         PyModule_AddObject(m, "EVT_ID_USER_ADDED_TO_LOCAL_SEC_GROUP", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_USER_ADDED_TO_LOCAL_SEC_GROUP)));
      93          18 :         PyModule_AddObject(m, "EVT_ID_USER_REMOVED_FROM_LOCAL_SEC_GROUP", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_USER_REMOVED_FROM_LOCAL_SEC_GROUP)));
      94          18 :         PyModule_AddObject(m, "EVT_ID_USER_ADDED_TO_LOCAL_GROUP", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_USER_ADDED_TO_LOCAL_GROUP)));
      95          18 :         PyModule_AddObject(m, "EVT_ID_USER_REMOVED_FROM_LOCAL_GROUP", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_USER_REMOVED_FROM_LOCAL_GROUP)));
      96          18 :         PyModule_AddObject(m, "EVT_ID_USER_ADDED_TO_GLOBAL_GROUP", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_USER_ADDED_TO_GLOBAL_GROUP)));
      97          18 :         PyModule_AddObject(m, "EVT_ID_USER_REMOVED_FROM_GLOBAL_GROUP", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_USER_REMOVED_FROM_GLOBAL_GROUP)));
      98          18 :         PyModule_AddObject(m, "EVT_ID_USER_ADDED_TO_UNIVERSAL_SEC_GROUP", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_USER_ADDED_TO_UNIVERSAL_SEC_GROUP)));
      99          18 :         PyModule_AddObject(m, "EVT_ID_USER_REMOVED_FROM_UNIVERSAL_SEC_GROUP", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_USER_REMOVED_FROM_UNIVERSAL_SEC_GROUP)));
     100          18 :         PyModule_AddObject(m, "EVT_ID_USER_ADDED_TO_UNIVERSAL_GROUP", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_USER_ADDED_TO_UNIVERSAL_GROUP)));
     101          18 :         PyModule_AddObject(m, "EVT_ID_USER_REMOVED_FROM_UNIVERSAL_GROUP", PyLong_FromUnsignedLongLong((uint32_t)(EVT_ID_USER_REMOVED_FROM_UNIVERSAL_GROUP)));
     102          18 :         PyModule_AddObject(m, "AUTH_EVT_ID_NONE", PyLong_FromUnsignedLongLong((uint32_t)(AUTH_EVT_ID_NONE)));
     103          18 :         PyModule_AddObject(m, "AUTH_EVT_ID_NTLM_DEVICE_RESTRICTION", PyLong_FromUnsignedLongLong((uint32_t)(AUTH_EVT_ID_NTLM_DEVICE_RESTRICTION)));
     104          18 :         PyModule_AddObject(m, "AUTH_EVT_ID_KERBEROS_DEVICE_RESTRICTION", PyLong_FromUnsignedLongLong((uint32_t)(AUTH_EVT_ID_KERBEROS_DEVICE_RESTRICTION)));
     105          18 :         PyModule_AddObject(m, "AUTH_EVT_ID_KERBEROS_DEVICE_RESTRICTION_AUDIT", PyLong_FromUnsignedLongLong((uint32_t)(AUTH_EVT_ID_KERBEROS_DEVICE_RESTRICTION_AUDIT)));
     106          18 :         PyModule_AddObject(m, "AUTH_EVT_ID_KERBEROS_SERVER_RESTRICTION", PyLong_FromUnsignedLongLong((uint32_t)(AUTH_EVT_ID_KERBEROS_SERVER_RESTRICTION)));
     107          18 :         PyModule_AddObject(m, "AUTH_EVT_ID_KERBEROS_SERVER_RESTRICTION_AUDIT", PyLong_FromUnsignedLongLong((uint32_t)(AUTH_EVT_ID_KERBEROS_SERVER_RESTRICTION_AUDIT)));
     108          18 :         PyModule_AddObject(m, "EVT_LOGON_INTERACTIVE", PyLong_FromUnsignedLongLong((uint32_t)(EVT_LOGON_INTERACTIVE)));
     109          18 :         PyModule_AddObject(m, "EVT_LOGON_NETWORK", PyLong_FromUnsignedLongLong((uint32_t)(EVT_LOGON_NETWORK)));
     110          18 :         PyModule_AddObject(m, "EVT_LOGON_BATCH", PyLong_FromUnsignedLongLong((uint32_t)(EVT_LOGON_BATCH)));
     111          18 :         PyModule_AddObject(m, "EVT_LOGON_SERVICE", PyLong_FromUnsignedLongLong((uint32_t)(EVT_LOGON_SERVICE)));
     112          18 :         PyModule_AddObject(m, "EVT_LOGON_UNLOCK", PyLong_FromUnsignedLongLong((uint32_t)(EVT_LOGON_UNLOCK)));
     113          18 :         PyModule_AddObject(m, "EVT_LOGON_NETWORK_CLEAR_TEXT", PyLong_FromUnsignedLongLong((uint32_t)(EVT_LOGON_NETWORK_CLEAR_TEXT)));
     114          18 :         PyModule_AddObject(m, "EVT_LOGON_NEW_CREDENTIALS", PyLong_FromUnsignedLongLong((uint32_t)(EVT_LOGON_NEW_CREDENTIALS)));
     115          18 :         PyModule_AddObject(m, "EVT_LOGON_REMOTE_INTERACTIVE", PyLong_FromUnsignedLongLong((uint32_t)(EVT_LOGON_REMOTE_INTERACTIVE)));
     116          18 :         PyModule_AddObject(m, "EVT_LOGON_CACHED_INTERACTIVE", PyLong_FromUnsignedLongLong((uint32_t)(EVT_LOGON_CACHED_INTERACTIVE)));
     117             : #ifdef PY_MOD_WINDOWS_EVENT_IDS_PATCH
     118             :         PY_MOD_WINDOWS_EVENT_IDS_PATCH(m);
     119             : #endif
     120          18 :         out:
     121          18 :         return m;
     122             : 
     123             : }

Generated by: LCOV version 1.14