2011-08-28 21:27:06 +00:00
|
|
|
/* IPXWrapper - Common header
|
|
|
|
* Copyright (C) 2011 Daniel Collins <solemnwarning@solemnwarning.net>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 as published by
|
|
|
|
* the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program; if not, write to the Free Software Foundation, Inc., 51
|
|
|
|
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef IPXWRAPPER_COMMON_H
|
|
|
|
#define IPXWRAPPER_COMMON_H
|
|
|
|
|
|
|
|
#include <windows.h>
|
2011-08-29 10:03:58 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdint.h>
|
2012-10-21 11:00:03 +00:00
|
|
|
#include <stdbool.h>
|
2011-08-29 10:03:58 +00:00
|
|
|
|
2012-10-21 10:26:52 +00:00
|
|
|
#include "addr.h"
|
2011-08-29 10:03:58 +00:00
|
|
|
|
2012-11-11 23:57:35 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2011-11-16 21:32:59 +00:00
|
|
|
enum ipx_log_level {
|
|
|
|
LOG_CALL = 1,
|
|
|
|
LOG_DEBUG,
|
|
|
|
LOG_INFO = 4,
|
|
|
|
LOG_WARNING,
|
|
|
|
LOG_ERROR
|
|
|
|
};
|
2011-08-28 21:27:06 +00:00
|
|
|
|
2011-11-16 21:32:59 +00:00
|
|
|
extern enum ipx_log_level min_log_level;
|
2011-08-28 21:27:06 +00:00
|
|
|
|
|
|
|
const char *w32_error(DWORD errnum);
|
|
|
|
|
2012-10-21 10:26:52 +00:00
|
|
|
HKEY reg_open_main(bool readwrite);
|
|
|
|
HKEY reg_open_subkey(HKEY parent, const char *path, bool readwrite);
|
|
|
|
void reg_close(HKEY key);
|
2011-08-28 21:27:06 +00:00
|
|
|
|
2012-11-12 20:42:55 +00:00
|
|
|
bool reg_check_value(HKEY key, const char *name);
|
|
|
|
|
2012-10-21 10:26:52 +00:00
|
|
|
bool reg_get_bin(HKEY key, const char *name, void *buf, size_t size, const void *default_value);
|
2012-10-28 12:57:28 +00:00
|
|
|
bool reg_set_bin(HKEY key, const char *name, void *buf, size_t size);
|
|
|
|
|
2012-10-21 10:26:52 +00:00
|
|
|
DWORD reg_get_dword(HKEY key, const char *name, DWORD default_value);
|
2012-10-28 12:57:28 +00:00
|
|
|
bool reg_set_dword(HKEY key, const char *name, DWORD value);
|
2011-08-28 21:27:06 +00:00
|
|
|
|
2014-01-03 01:18:50 +00:00
|
|
|
addr32_t reg_get_addr32(HKEY key, const char *name, addr32_t default_value);
|
|
|
|
bool reg_set_addr32(HKEY key, const char *name, addr32_t value);
|
|
|
|
|
|
|
|
addr48_t reg_get_addr48(HKEY key, const char *name, addr48_t default_value);
|
|
|
|
bool reg_set_addr48(HKEY key, const char *name, addr48_t value);
|
|
|
|
|
2011-09-11 13:28:41 +00:00
|
|
|
void load_dll(unsigned int dllnum);
|
|
|
|
void unload_dlls(void);
|
|
|
|
void __stdcall *find_sym(unsigned int dllnum, const char *symbol);
|
2014-01-12 17:26:51 +00:00
|
|
|
void __stdcall log_call(unsigned int entry, const char *symbol, unsigned int target);
|
2011-08-28 21:27:06 +00:00
|
|
|
|
2011-09-18 14:36:24 +00:00
|
|
|
void log_open(const char *file);
|
|
|
|
void log_close();
|
2011-11-16 21:32:59 +00:00
|
|
|
void log_printf(enum ipx_log_level level, const char *fmt, ...);
|
2011-09-18 14:36:24 +00:00
|
|
|
|
2012-11-11 23:57:35 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-08-28 21:27:06 +00:00
|
|
|
#endif /* !IPXWRAPPER_COMMON_H */
|