w1146869587
2021-11-05 cbf39419a8299e7d119618e5e8e1b1eb35f72f45
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <efsw/platform/win/SystemImpl.hpp>
#include <efsw/String.hpp>
 
#if EFSW_PLATFORM == EFSW_PLATFORM_WIN32
 
#ifndef WIN32_LEAN_AND_MEAN
    #define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <cstdlib>
 
namespace efsw { namespace Platform {
 
void System::sleep( const unsigned long& ms )
{
    ::Sleep( ms );
}
 
std::string System::getProcessPath()
{
    // Get path to executable:
    WCHAR szDrive[_MAX_DRIVE];
    WCHAR szDir[_MAX_DIR];
    WCHAR szFilename[_MAX_DIR];
    WCHAR szExt[_MAX_DIR];
    std::wstring dllName( _MAX_DIR, 0 );
 
    GetModuleFileNameW(0, &dllName[0], _MAX_PATH);
 
    #ifdef EFSW_COMPILER_MSVC
    _wsplitpath_s( dllName.c_str(), szDrive, _MAX_DRIVE, szDir, _MAX_DIR, szFilename, _MAX_DIR, szExt, _MAX_DIR );
    #else
    _wsplitpath( dllName.c_str(), szDrive, szDir, szFilename, szExt);
    #endif
 
    return String( szDrive ).toUtf8() + String( szDir ).toUtf8();
}
 
void System::maxFD()
{
}
 
Uint64 System::getMaxFD()
{    // Number of ReadDirectory per thread
    return 60;
}
 
}}
 
#endif