Pyrogenesis
13997
|
#include "precompiled.h"
#include "lib/sysdep/sysdep.h"
#include "lib/alignment.h"
#include "lib/sysdep/os/win/win.h"
#include <shlobj.h>
#include <shellapi.h>
#include <Wincrypt.h>
#include <WindowsX.h>
#include <winhttp.h>
#include "lib/sysdep/clipboard.h"
#include "lib/sysdep/os/win/error_dialog.h"
#include "lib/sysdep/os/win/wutil.h"
Go to the source code of this file.
Classes | |
struct | DialogParams |
Functions | |
bool | sys_IsDebuggerPresent () |
std::wstring | sys_WideFromArgv (const char *argv_i) |
void | sys_display_msg (const wchar_t *caption, const wchar_t *msg) |
display a message. More... | |
static void | dlg_OnMove (HWND hDlg, int x, int y) |
static void | dlg_ResizeControl (HWND hDlg, int dlgItem, int dx, int dy, size_t anchors) |
static void | dlg_OnSize (HWND hDlg, UINT state, int clientSizeX, int clientSizeY) |
static void | dlg_OnGetMinMaxInfo (HWND hDlg, LPMINMAXINFO mmi) |
static BOOL | dlg_OnInitDialog (HWND hDlg, HWND hWndFocus, LPARAM lParam) |
static void | dlg_OnCommand (HWND hDlg, int id, HWND hWndCtl, UINT codeNotify) |
static void | dlg_OnSysCommand (HWND hDlg, UINT cmd, int x, int y) |
static INT_PTR CALLBACK | dlg_OnMessage (HWND hDlg, unsigned int msg, WPARAM wParam, LPARAM lParam) |
ErrorReactionInternal | sys_display_error (const wchar_t *text, size_t flags) |
show the error dialog. More... | |
Status | sys_StatusDescription (int user_err, wchar_t *buf, size_t max_chars) |
describe the current OS error state. More... | |
static Status | GetModulePathname (HMODULE hModule, OsPath &pathname) |
Status | sys_get_module_filename (void *addr, OsPath &pathname) |
determine filename of the module to whom an address belongs. More... | |
OsPath | sys_ExecutablePathname () |
std::wstring | sys_get_user_name () |
Get the current user's login name. More... | |
static int CALLBACK | BrowseCallback (HWND hWnd, unsigned int msg, LPARAM lParam, LPARAM lpData) |
Status | sys_pick_directory (OsPath &path) |
Have the user choose a directory via OS dialog. More... | |
Status | sys_open_url (const std::string &url) |
Open the user's default web browser to the given URL. More... | |
Status | sys_generate_random_bytes (u8 *buffer, size_t size) |
generate high-quality random bytes. More... | |
FILE * | sys_OpenFile (const OsPath &pathname, const char *mode) |
open a file like with fopen (but taking an OsPath argument). More... | |
Variables | |
static POINTS | dlg_clientOrigin |
static POINTS | dlg_prevClientSize |
static const size_t | ANCHOR_LEFT = 0x01 |
static const size_t | ANCHOR_RIGHT = 0x02 |
static const size_t | ANCHOR_TOP = 0x04 |
static const size_t | ANCHOR_BOTTOM = 0x08 |
static const size_t | ANCHOR_ALL = 0x0F |
|
static |
Definition at line 416 of file wsysdep.cpp.
|
static |
Definition at line 209 of file wsysdep.cpp.
|
static |
Definition at line 167 of file wsysdep.cpp.
|
static |
Definition at line 183 of file wsysdep.cpp.
|
static |
Definition at line 255 of file wsysdep.cpp.
|
static |
Definition at line 91 of file wsysdep.cpp.
|
static |
Definition at line 137 of file wsysdep.cpp.
|
static |
Definition at line 240 of file wsysdep.cpp.
|
static |
Definition at line 104 of file wsysdep.cpp.
Definition at line 371 of file wsysdep.cpp.
ErrorReactionInternal sys_display_error | ( | const wchar_t * | text, |
size_t | flags | ||
) |
show the error dialog.
text | to display (practically unlimited length) |
flags,: | see DebugDisplayErrorFlags. |
called from debug_DisplayError unless overridden by means of ah_display_error.
Definition at line 284 of file wsysdep.cpp.
display a message.
caption | title message |
msg | message contents |
implemented as a MessageBox on Win32 and printf on Unix. called from debug_DisplayMessage.
Definition at line 76 of file wsysdep.cpp.
OsPath sys_ExecutablePathname | ( | ) |
this is useful for determining installation directory, e.g. for VFS.
Definition at line 395 of file wsysdep.cpp.
generate high-quality random bytes.
this should only be used with small numbers of bytes, to avoid hogging the system's entropy.
Definition at line 476 of file wsysdep.cpp.
determine filename of the module to whom an address belongs.
addr | |
pathname | Full path to module (unchanged unless INFO::OK is returned). |
note: this is useful for handling exceptions in other modules.
Definition at line 384 of file wsysdep.cpp.
std::wstring sys_get_user_name | ( | ) |
Get the current user's login name.
Definition at line 404 of file wsysdep.cpp.
bool sys_IsDebuggerPresent | ( | ) |
Definition at line 53 of file wsysdep.cpp.
Status sys_open_url | ( | const std::string & | url | ) |
Open the user's default web browser to the given URL.
Definition at line 466 of file wsysdep.cpp.
FILE* sys_OpenFile | ( | const OsPath & | pathname, |
const char * | mode | ||
) |
open a file like with fopen (but taking an OsPath argument).
Definition at line 606 of file wsysdep.cpp.
Have the user choose a directory via OS dialog.
path | Path's input value determines the starting directory for faster browsing. if INFO::OK is returned, it receives chosen directory path. |
Definition at line 428 of file wsysdep.cpp.
describe the current OS error state.
err,: | if not 0, use that as the error code to translate; otherwise, uses GetLastError or similar. |
buf | output buffer |
max_chars | rationale: it is expected to be rare that OS return/error codes are actually seen by user code, but we leave the possibility open. |
Definition at line 334 of file wsysdep.cpp.
std::wstring sys_WideFromArgv | ( | const char * | argv_i | ) |
(NB: wseh.cpp defines a wmain that converts argv to UTF-8 and calls main(), but only if LIB_STATIC_LINK)
Definition at line 59 of file wsysdep.cpp.
|
static |
Definition at line 102 of file wsysdep.cpp.
|
static |
Definition at line 101 of file wsysdep.cpp.
|
static |
Definition at line 98 of file wsysdep.cpp.
|
static |
Definition at line 99 of file wsysdep.cpp.
|
static |
Definition at line 100 of file wsysdep.cpp.
|
static |
Definition at line 88 of file wsysdep.cpp.
|
static |
Definition at line 89 of file wsysdep.cpp.