# Path: windows/generated_def/ntstatus.py
# class NtStatusException(Exception):
#     ALL_STATUS = {}
#     def __init__(self , code):
#         try:
#             x = self.ALL_STATUS[code]
#         except KeyError:
#             x = (code, 'UNKNOW_ERROR', 'Error non documented in ntstatus.py')
#         self.code = x[0]
#         self.name = x[1]
#         self.descr = x[2]
#             
#         return super(NtStatusException, self).__init__(*x)
# 
#     def __str__(self):
#         return "{e.name}(0x{e.code:x}): {e.descr}".format(e=self)
# 
#     @classmethod
#     def register_ntstatus(cls, code, name, descr):
#         if code in cls.ALL_STATUS:
#             return # Use the first def
#         cls.ALL_STATUS[code] = (code, name, descr)
# 
# Path: windows/dbgprint.py
# def get_stack_func_name(lvl):
# def do_dbgprint(msg, type=None):
# def do_nothing(*args, **kwargs):
# def parse_option(s):


import ctypes
import functools
import windows.generated_def.winfuncs as winfuncs
from ctypes.wintypes import *
from windows.generated_def.winstructs import *
from windows.generated_def.windef import *
from windows.generated_def.ntstatus import NtStatusException
from windows.dbgprint import dbgprint



kernel32 = ctypes.windll.kernel32
advapi32 = ctypes.windll.Advapi32
iphlpapi = ctypes.windll.iphlpapi
ntdll = ctypes.windll.ntdll


class Kernel32Error(WindowsError):
    def __new__(cls, func_name):
        win_error = ctypes.WinError()
        api_error = super(Kernel32Error, cls).__new__(cls)
        api_error.api_name = func_name
        api_error.winerror = win_error.winerror
        api_error.strerror = win_error.strerror
        api_error.args = (func_name, win_error.winerror, win_error.strerror)
        return api_error

    def __repr__(self):
        return "{0}: {1}".format(self.api_name, super(Kernel32Error, self).__repr__())

    def __str__(self):

# Path: windows/generated_def/ntstatus.py
# class NtStatusException(Exception):
#     ALL_STATUS = {}
#     def __init__(self , code):
#         try:
#             x = self.ALL_STATUS[code]
#         except KeyError:
#             x = (code, 'UNKNOW_ERROR', 'Error non documented in ntstatus.py')
#         self.code = x[0]
#         self.name = x[1]
#         self.descr = x[2]
#             
#         return super(NtStatusException, self).__init__(*x)
# 
#     def __str__(self):
#         return "{e.name}(0x{e.code:x}): {e.descr}".format(e=self)
# 
#     @classmethod
#     def register_ntstatus(cls, code, name, descr):
#         if code in cls.ALL_STATUS:
#             return # Use the first def
#         cls.ALL_STATUS[code] = (code, name, descr)
# 
# Path: windows/dbgprint.py
# def get_stack_func_name(lvl):
# def do_dbgprint(msg, type=None):
# def do_nothing(*args, **kwargs):
# def parse_option(s):


# Path: windows/winproxy.py
import ctypes
import functools
import windows.generated_def.winfuncs as winfuncs
from ctypes.wintypes import *
from windows.generated_def.winstructs import *
from windows.generated_def.windef import *
from windows.generated_def.ntstatus import NtStatusException
from windows.dbgprint import dbgprint




kernel32 = ctypes.windll.kernel32
advapi32 = ctypes.windll.Advapi32
iphlpapi = ctypes.windll.iphlpapi
ntdll = ctypes.windll.ntdll


class Kernel32Error(WindowsError):
    def __new__(cls, func_name):
        win_error = ctypes.WinError()
        api_error = super(Kernel32Error, cls).__new__(cls)
        api_error.api_name = func_name
        api_error.winerror = win_error.winerror
        api_error.strerror = win_error.strerror
        api_error.args = (func_name, win_error.winerror, win_error.strerror)
        return api_error

    def __repr__(self):
        return "{0}: {1}".format(self.api_name, super(Kernel32Error, self).__repr__())

    def __str__(self):

        return "{0}: {1}".format(self.api_name, super(Kernel32Error, self).__str__())