foobar2000 SDK  2015-08-03
Functions
pp-winapi.h File Reference

Go to the source code of this file.

Functions

HANDLE CreateEvent (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCTSTR lpName)
 
HANDLE CreateFileW (LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
 
HANDLE FindFirstFile (LPCTSTR lpFileName, LPWIN32_FIND_DATA lpFindFileData)
 
DWORD GetFileAttributesW (const wchar_t *path)
 
BOOL GetFileSizeEx (HANDLE hFile, PLARGE_INTEGER lpFileSize)
 
void InitializeCriticalSection (LPCRITICAL_SECTION lpCriticalSection)
 
DWORD WaitForMultipleObjects (DWORD nCount, const HANDLE *lpHandles, BOOL bWaitAll, DWORD dwMilliseconds)
 
DWORD WaitForSingleObject (HANDLE hHandle, DWORD dwMilliseconds)
 

Function Documentation

HANDLE CreateEvent ( LPSECURITY_ATTRIBUTES  lpEventAttributes,
BOOL  bManualReset,
BOOL  bInitialState,
LPCTSTR  lpName 
)
inline

Definition at line 8 of file pp-winapi.h.

8  {
9  DWORD flags = 0;
10  if (bManualReset) flags |= CREATE_EVENT_MANUAL_RESET;
11  if (bInitialState) flags |= CREATE_EVENT_INITIAL_SET;
12  DWORD rights = SYNCHRONIZE | EVENT_MODIFY_STATE;
13  return CreateEventEx(lpEventAttributes, lpName, flags, rights);
14 }
HANDLE CreateFileW ( LPCTSTR  lpFileName,
DWORD  dwDesiredAccess,
DWORD  dwShareMode,
LPSECURITY_ATTRIBUTES  lpSecurityAttributes,
DWORD  dwCreationDisposition,
DWORD  dwFlagsAndAttributes,
HANDLE  hTemplateFile 
)
inline

Definition at line 39 of file pp-winapi.h.

39  {
40  CREATEFILE2_EXTENDED_PARAMETERS arg = {};
41  arg.dwSize = sizeof(arg);
42  arg.hTemplateFile = hTemplateFile;
43  arg.lpSecurityAttributes = lpSecurityAttributes;
44  arg.dwFileAttributes = dwFlagsAndAttributes & 0x0000FFFF;
45  arg.dwFileFlags = dwFlagsAndAttributes & 0xFFFF0000;
46  return CreateFile2(lpFileName, dwDesiredAccess, dwShareMode, dwCreationDisposition, &arg);
47 }
HANDLE FindFirstFile ( LPCTSTR  lpFileName,
LPWIN32_FIND_DATA  lpFindFileData 
)
inline

Definition at line 28 of file pp-winapi.h.

28  {
29  return FindFirstFileEx(lpFileName, FindExInfoStandard, lpFindFileData, FindExSearchNameMatch, NULL, 0);
30 }
DWORD GetFileAttributesW ( const wchar_t *  path)
inline

Definition at line 49 of file pp-winapi.h.

49  {
50  WIN32_FILE_ATTRIBUTE_DATA data = {};
51  if (!GetFileAttributesEx(path, GetFileExInfoStandard, &data)) return 0xFFFFFFFF;
52  return data.dwFileAttributes;
53 }
BOOL GetFileSizeEx ( HANDLE  hFile,
PLARGE_INTEGER  lpFileSize 
)
inline

Definition at line 32 of file pp-winapi.h.

32  {
33  FILE_STANDARD_INFO info;
34  if (!GetFileInformationByHandleEx(hFile, FileStandardInfo, &info, sizeof(info))) return FALSE;
35  *lpFileSize = info.EndOfFile;
36  return TRUE;
37 }
void info(const char *p_message)
Definition: console.cpp:4
void InitializeCriticalSection ( LPCRITICAL_SECTION  lpCriticalSection)
inline

Definition at line 24 of file pp-winapi.h.

24  {
25  InitializeCriticalSectionEx(lpCriticalSection, 0, 0);
26 }
DWORD WaitForMultipleObjects ( DWORD  nCount,
const HANDLE lpHandles,
BOOL  bWaitAll,
DWORD  dwMilliseconds 
)
inline

Definition at line 20 of file pp-winapi.h.

20  {
21  return WaitForMultipleObjectsEx(nCount, lpHandles, bWaitAll, dwMilliseconds, FALSE);
22 }
DWORD WaitForSingleObject ( HANDLE  hHandle,
DWORD  dwMilliseconds 
)
inline

Definition at line 16 of file pp-winapi.h.

16  {
17  return WaitForSingleObjectEx(hHandle, dwMilliseconds, FALSE);
18 }