Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1960 lines
43 KiB

  1. // Copyright (c) 1997-1999 Microsoft Corporation
  2. //
  3. // Wrappers of Win APIs
  4. //
  5. // 8-14-97 sburns
  6. #ifndef WIN_HPP_INCLUDED
  7. #define WIN_HPP_INCLUDED
  8. // Wrappers of Win32 APIs, doing such nice things as taking Strings
  9. // as parameters, asserting parameters and return values, assuming
  10. // certain parameters such as resource instance handles, and other
  11. // stuff.
  12. //
  13. // Each function name is identical to the API function it wraps.
  14. namespace Burnslib
  15. {
  16. namespace Win
  17. {
  18. // Win::Error is a subclass of ::Error that automatically maps
  19. // error codes to message strings, pulling the strings string from
  20. // various windows system resources.
  21. class Error : public ::Error
  22. {
  23. public:
  24. // Constructs a new instance.
  25. //
  26. // hr - The HRESULT to keep track of.
  27. //
  28. // summaryResID - ID of the string resource that corresponds to
  29. // the summary text to be returned by GetSummary().
  30. Error(HRESULT hr, int summaryResID);
  31. virtual
  32. ~Error()
  33. {
  34. }
  35. // Overrides the default windows message text.
  36. //
  37. // hr - The HRESULT to keep track of.
  38. //
  39. // message - The error message that will be returned by calls to
  40. // GetMessage.
  41. //
  42. // summary - the string that will be returned by calls to GetSummary
  43. Error(HRESULT hr, const String& message, const String& summary);
  44. HRESULT
  45. GetHresult() const;
  46. // Returns the HelpContext that will point the user to
  47. // assistance in deciphering the error message and details. For
  48. // this implementation, this is just the HRESULT parameter
  49. // passed to the ctor.
  50. virtual
  51. HelpContext
  52. GetHelpContext() const;
  53. // Returns the human readable error message from the system
  54. // error message string table(s).
  55. virtual
  56. String
  57. GetMessage() const;
  58. // returns a 1-line summary: The essence of the error, suitable
  59. // for use as the title of a reporting dialog, for instance.
  60. virtual
  61. String
  62. GetSummary() const;
  63. const Error& operator=(const Error& rhs);
  64. private:
  65. HRESULT hr;
  66. mutable String message;
  67. mutable String summary;
  68. int summaryResId;
  69. };
  70. // A CursorSetting is a convenient trick to change the cursor only
  71. // for the lifetime of a single code block. When an instance is
  72. // constructed, the cursor is changed. When it is destroyed, the
  73. // old cursor is restored.
  74. //
  75. // Example:
  76. //
  77. // { // open block scope
  78. // Win::CursorSetting scope(IDC_WAIT);
  79. // // the cursor is now IDC_WAIT
  80. //
  81. // // do something time consuming
  82. // } // close block scope
  83. // // scope destroyed; the cursor is restored to what it was before
  84. // NOTE: not threadsafe: do not use the same CursorSetting object from
  85. // multiple threads.
  86. class CursorSetting
  87. {
  88. public:
  89. // Construct a new instance with the named cursor resource.
  90. explicit
  91. CursorSetting(const String& newCursorName);
  92. // MAKEINTRESOURCE version
  93. explicit
  94. CursorSetting(
  95. const TCHAR* newCursorName,
  96. bool isSystemCursor = true);
  97. // Construct a new instance from a valid HCURSOR.
  98. explicit
  99. CursorSetting(HCURSOR newCursor);
  100. ~CursorSetting();
  101. private:
  102. HCURSOR oldCursor;
  103. void init(
  104. const TCHAR* cursorName,
  105. bool isSystemCursor = true);
  106. // these are not defined
  107. CursorSetting(const CursorSetting&);
  108. const CursorSetting& operator=(const CursorSetting&);
  109. };
  110. class WaitCursor : public CursorSetting
  111. {
  112. public:
  113. WaitCursor()
  114. :
  115. CursorSetting(IDC_WAIT)
  116. {
  117. }
  118. private:
  119. // these are not defined
  120. WaitCursor(const WaitCursor&);
  121. const WaitCursor& operator=(const WaitCursor&);
  122. };
  123. HRESULT
  124. AdjustTokenPrivileges(
  125. HANDLE tokenHandle,
  126. bool disableAllPrivileges,
  127. TOKEN_PRIVILEGES newState[]);
  128. // Previous state must be freed with BYTE::delete[], which should be done
  129. // whether or not the function returns a success code. See
  130. // AutoTokenPrivileges for a friendly wrapper.
  131. //
  132. // tokenHandle - a token opened with TOKEN_ADJUST_PRIVILEGES and
  133. // TOKEN_QUERY permissions.
  134. //
  135. // see the win32 API docs for the meaning of the other params.
  136. //
  137. // Ex.
  138. //
  139. // TOKEN_PRIVILEGES* oldPrivs = 0;
  140. // HRESULT hr = AdjustTokenPrivileges(,,,oldPrivs);
  141. // // do stuff...
  142. // hr = AdjustTokenPrivileges(,,oldPrivs); // i.e. the other overload
  143. // delete[] (BYTE*) oldPrivs;
  144. // oldPrivs = 0;
  145. HRESULT
  146. AdjustTokenPrivileges(
  147. HANDLE tokenHandle,
  148. bool disableAllPrivileges,
  149. TOKEN_PRIVILEGES newState[],
  150. TOKEN_PRIVILEGES*& previousState);
  151. HRESULT
  152. AllocateAndInitializeSid(
  153. SID_IDENTIFIER_AUTHORITY& authority,
  154. BYTE subAuthorityCount,
  155. DWORD subAuthority0,
  156. DWORD subAuthority1,
  157. DWORD subAuthority2,
  158. DWORD subAuthority3,
  159. DWORD subAuthority4,
  160. DWORD subAuthority5,
  161. DWORD subAuthority6,
  162. DWORD subAuthority7,
  163. PSID& sid);
  164. #undef Animate_Close
  165. void
  166. Animate_Close(HWND animation);
  167. #undef Animate_Open
  168. void
  169. Animate_Open(HWND animation, const TCHAR* animationNameOrRes);
  170. #undef Animate_Stop
  171. void
  172. Animate_Stop(HWND animation);
  173. HRESULT
  174. AppendMenu(
  175. HMENU menu,
  176. UINT flags,
  177. UINT_PTR idNewItem,
  178. PCTSTR newItem);
  179. #undef Button_SetCheck
  180. void
  181. Button_SetCheck(HWND button, int checkState);
  182. #undef Button_GetCheck
  183. bool
  184. Button_GetCheck(HWND button);
  185. #undef Button_SetStyle
  186. void
  187. Button_SetStyle(HWND button, int style, bool redraw);
  188. void
  189. CheckDlgButton(HWND parentDialog, int buttonID, UINT buttonState);
  190. void
  191. CheckRadioButton(
  192. HWND parentDialog,
  193. int firstButtonInGroupID,
  194. int lastButtonInGroupID,
  195. int buttonInGroupToCheckID);
  196. // sets the handle to INVALID_HANDLE_VALUE
  197. void
  198. CloseHandle(HANDLE& handle);
  199. void
  200. CloseServiceHandle(SC_HANDLE handle);
  201. #undef ComboBox_AddString
  202. int
  203. ComboBox_AddString(HWND combo, const String& s);
  204. // Adds all of the strings in the range defined by the provided iterators
  205. // to the combo box control, and returns the 0-based index of the last
  206. // string added. Returns CB_ERR if an error occurred, or CB_ERRSPACE if
  207. // insufficient space is available to add the string.
  208. //
  209. // Each element is added in the sequence provided by the iterators. If an
  210. // error is encountered, the iteration stops, and the error value is
  211. // returned. In other words, remaining elements in the iteration are
  212. // skipped.
  213. //
  214. // Each element must be a String, or a type convertible to String (PWSTR,
  215. // etc.)
  216. //
  217. // combo - a HWND for a combo box.
  218. //
  219. // first - a forward iterator set to the first element in the sequence to
  220. // be added to the combo box.
  221. //
  222. // last - a forward iterator set to just beyond the last element of the
  223. // sequence.
  224. //
  225. // Example:
  226. //
  227. // StringList fooStrings;
  228. // fooStrings.push_back(L"hello");
  229. // fooStrings.push_back(L"world");
  230. //
  231. // int err =
  232. // Win::ComboBox_AddStrings(
  233. // combo,
  234. // fooStrings.begin(),
  235. // fooStrings.end());
  236. template<class ForwardIterator>
  237. int
  238. ComboBox_AddStrings(
  239. HWND combo,
  240. ForwardIterator first,
  241. ForwardIterator last)
  242. {
  243. ASSERT(Win::IsWindow(combo));
  244. int err = CB_ERR;
  245. for (
  246. // copy the iterators so as not to modify the actual parameters
  247. ForwardIterator f = first, l = last;
  248. f != l;
  249. ++f)
  250. {
  251. err = Win::ComboBox_AddString(combo, *f);
  252. if (err == CB_ERR || err == CB_ERRSPACE)
  253. {
  254. break;
  255. }
  256. }
  257. return err;
  258. }
  259. #undef ComboBox_GetCurSel
  260. int
  261. ComboBox_GetCurSel(HWND combo);
  262. // Retrieves the text of the selected item in the list box of the combo
  263. // or empty if no item is selected.
  264. String
  265. ComboBox_GetCurText(HWND combo);
  266. #undef ComboBox_GetLBText
  267. String
  268. ComboBox_GetLBText(HWND combo, int index);
  269. #undef ComboBox_GetLBTextLen
  270. int
  271. ComboBox_GetLBTextLen(HWND combo, int index);
  272. #undef ComboBox_SelectString
  273. int
  274. ComboBox_SelectString(HWND combo, const String& str);
  275. #undef ComboBox_SetCurSel
  276. void
  277. ComboBox_SetCurSel(HWND combo, int index);
  278. #undef ComboBox_SetItemData
  279. void
  280. ComboBox_SetItemData(HWND combo, int index, LPARAM data);
  281. #undef ComboBox_GetItemData
  282. LRESULT
  283. ComboBox_GetItemData(HWND combo, int index);
  284. int
  285. CompareString(
  286. LCID locale,
  287. DWORD flags,
  288. const String& string1,
  289. const String& string2);
  290. HRESULT
  291. ConnectNamedPipe(
  292. HANDLE pipe,
  293. OVERLAPPED* overlapped);
  294. HRESULT
  295. ConvertSidToStringSid(PSID sid, String& result);
  296. // sid must be freed with LocalFree
  297. HRESULT
  298. ConvertStringSidToSid(const String& sidString, PSID& sid);
  299. HRESULT
  300. CopyFileEx(
  301. const String& existingFileName,
  302. const String& newFileName,
  303. LPPROGRESS_ROUTINE progressRoutine,
  304. void* progressParam,
  305. BOOL* cancelFlag,
  306. DWORD flags);
  307. HRESULT
  308. CopySid(DWORD destLengthInBytes, PSID dest, PSID source);
  309. HRESULT
  310. CreateDialogParam(
  311. HINSTANCE hInstance,
  312. const TCHAR* templateName,
  313. HWND owner,
  314. DLGPROC dialogProc,
  315. LPARAM param,
  316. HWND& result);
  317. HRESULT
  318. CreateDirectory(const String& path);
  319. HRESULT
  320. CreateDirectory(const String& path, const SECURITY_ATTRIBUTES& sa);
  321. HRESULT
  322. CreateEvent(
  323. SECURITY_ATTRIBUTES* securityAttributes,
  324. bool manualReset,
  325. bool initiallySignaled,
  326. HANDLE& result);
  327. HRESULT
  328. CreateEvent(
  329. SECURITY_ATTRIBUTES* securityAttributes,
  330. bool manualReset,
  331. bool initiallySignaled,
  332. const String& name,
  333. HANDLE& result);
  334. HRESULT
  335. CreateFile(
  336. const String& fileName,
  337. DWORD desiredAccess,
  338. DWORD shareMode,
  339. SECURITY_ATTRIBUTES* securityAttributes,
  340. DWORD creationDistribution,
  341. DWORD flagsAndAttributes,
  342. HANDLE hTemplateFile,
  343. HANDLE& result);
  344. HRESULT
  345. DeleteFile(const String& fileName);
  346. HRESULT
  347. CreateFontIndirect(
  348. const LOGFONT& logFont,
  349. HFONT& result);
  350. HRESULT
  351. CreateMailslot(
  352. const String& name,
  353. DWORD maxMessageSize,
  354. DWORD readTimeout,
  355. SECURITY_ATTRIBUTES* attributes,
  356. HANDLE& result);
  357. HRESULT
  358. CreateMutex(
  359. SECURITY_ATTRIBUTES* attributes,
  360. bool isInitialOwner,
  361. const String& name,
  362. HANDLE& result);
  363. HRESULT
  364. CreateNamedPipe(
  365. const String& name,
  366. DWORD openMode,
  367. DWORD pipeMode,
  368. DWORD maxInstances,
  369. DWORD outBufferSizeInBytes,
  370. DWORD inBufferSizeInBytes,
  371. DWORD defaultTimeout,
  372. SECURITY_ATTRIBUTES* sa,
  373. HANDLE& result);
  374. HRESULT
  375. CreatePopupMenu(HMENU& result);
  376. #undef CreateProcess
  377. // ISSUE-2002/03/07-sburns depricate this version:
  378. HRESULT
  379. CreateProcess(
  380. String& commandLine,
  381. SECURITY_ATTRIBUTES* processAttributes,
  382. SECURITY_ATTRIBUTES* threadAttributes,
  383. bool inheritHandles,
  384. DWORD creationFlags,
  385. void* environment,
  386. const String& currentDirectory,
  387. STARTUPINFO& startupInformation,
  388. PROCESS_INFORMATION& processInformation);
  389. // applicationFullPath - REQUIRED. The win32 CreateProcess API allows the
  390. // application name to be unspecified. In that case, the command line param
  391. // needs to ensure that the executable is properly quoted. Also, the Win32
  392. // API allows a relative path to the application.
  393. //
  394. // Those characteristics are security vulnerabilities, so our version
  395. // requires the applicationFullPath, and requires it to be a full-qualified
  396. // absolute path name. Otherwise, E_INVALIDARG is returned
  397. //
  398. // commandLine - optional. The command line to be passed to the process
  399. // started. May be modified by the call, to what end I can't fathom. The
  400. // applicationFullPath will be prepended to this value to form the
  401. // customary first command line parameter.
  402. //
  403. // creationFlags - same as Win32 API.
  404. //
  405. // currentDirectory - optional, but if a non-empty string is passed, it
  406. // must be an absolute path to refer to an existing folder. Otherwise,
  407. // E_INVALIDARG is returned.
  408. //
  409. // startupInformation - same as Win32 API.
  410. //
  411. // processInformation - same as Win32 API.
  412. HRESULT
  413. CreateProcess(
  414. const String& applicationFullPath,
  415. String& commandLine,
  416. DWORD creationFlags,
  417. const String& currentDirectory,
  418. STARTUPINFO& startupInformation,
  419. PROCESS_INFORMATION& processInformation);
  420. HRESULT
  421. CreatePropertySheetPage(
  422. const PROPSHEETPAGE& pageInfo,
  423. HPROPSHEETPAGE& result);
  424. HRESULT
  425. CreateSolidBrush(
  426. COLORREF color,
  427. HBRUSH& result);
  428. HRESULT
  429. CreateStreamOnHGlobal(
  430. HGLOBAL hglobal,
  431. bool deleteOnRelease,
  432. IStream*& result);
  433. HRESULT
  434. CreateWindowEx(
  435. DWORD exStyle,
  436. const String& className,
  437. const String& windowName,
  438. DWORD style,
  439. int x,
  440. int y,
  441. int width,
  442. int height,
  443. HWND parent,
  444. HMENU menuOrChildID,
  445. void* param,
  446. HWND& result);
  447. // Caller must free the cypherText.pbData member with ::LocalFree
  448. HRESULT
  449. CryptProtectData(const DATA_BLOB& clearText, DATA_BLOB& cypherText);
  450. // Caller must free the clearText.pbData member with ::LocalFree
  451. HRESULT
  452. CryptUnprotectData(const DATA_BLOB& cypherText, DATA_BLOB& clearText);
  453. // for protecting in-memory buffers. On success, buffer is overwritten
  454. // with the cyphertext. On failure, the buffer is untouched.
  455. HRESULT
  456. CryptProtectMemory(
  457. void* buffer,
  458. size_t bufferSizeInBytes,
  459. DWORD flags = CRYPTPROTECTMEMORY_SAME_PROCESS);
  460. // must be called with the same flags as CryptProtectMemory. On success,
  461. // buffer is overwritten with the cleartext. On failure, the buffer is
  462. // untouched.
  463. HRESULT
  464. CryptUnprotectMemory(
  465. void* buffer,
  466. size_t bufferSizeInBytes,
  467. DWORD flags = CRYPTPROTECTMEMORY_SAME_PROCESS);
  468. HRESULT
  469. DeleteFile(const String& path);
  470. // object is set to 0
  471. HRESULT
  472. DeleteObject(HGDIOBJ& object);
  473. HRESULT
  474. DeleteObject(HFONT& object);
  475. HRESULT
  476. DeleteObject(HBITMAP& object);
  477. HRESULT
  478. DeleteObject(HBRUSH& object);
  479. // icon is set to 0
  480. HRESULT
  481. DestroyIcon(HICON& icon);
  482. // menu is set to 0
  483. HRESULT
  484. DestroyMenu(HMENU& menu);
  485. // page is set to 0
  486. HRESULT
  487. DestroyPropertySheetPage(HPROPSHEETPAGE& page);
  488. // window is set to 0
  489. HRESULT
  490. DestroyWindow(HWND& window);
  491. INT_PTR
  492. DialogBoxParam(
  493. HINSTANCE hInstance,
  494. const TCHAR* templateName,
  495. HWND owner,
  496. DLGPROC dialogProc,
  497. LPARAM param);
  498. // Returns the resource ID of the default push button control on the
  499. // dialog. If there is not, or on error, returns 0.
  500. int
  501. Dialog_GetDefaultButtonId(HWND dialog);
  502. // Sets the default push button on the dialog to the button with the
  503. // given resource ID. Note that this will not necessarily remove the
  504. // default pushbutton style from the button that previously had that
  505. // state (use Button_SetStyle to do that).
  506. void
  507. Dialog_SetDefaultButtonId(HWND dialog, int buttonResId);
  508. HRESULT
  509. DisconnectNamedPipe(HANDLE pipe);
  510. HRESULT
  511. DrawFocusRect(HDC dc, const RECT& rect);
  512. // appends text to the contents of an edit control.
  513. //
  514. // editbox - HWND of the edit control
  515. //
  516. // text - text to append. Must not be empty.
  517. //
  518. // preserveSelection - true to keep any active selection, false to move
  519. // the care to the end of the appended text.
  520. //
  521. // canUndo - true to allow undo of the append, false if not.
  522. void
  523. Edit_AppendText(
  524. HWND editbox,
  525. const String& text,
  526. bool preserveSelection = true,
  527. bool canUndo = true);
  528. #undef Edit_GetSel
  529. void
  530. Edit_GetSel(HWND editbox, int& start, int& end);
  531. #undef Edit_LimitText
  532. void
  533. Edit_LimitText(HWND editbox, int limit);
  534. #undef Edit_ReplaceSel
  535. void
  536. Edit_ReplaceSel(HWND editbox, const String& newText, bool canUndo);
  537. #undef Edit_SetSel
  538. void
  539. Edit_SetSel(HWND editbox, int start, int end);
  540. bool
  541. EqualSid(PSID sid1, PSID sid2);
  542. void
  543. EnableWindow(HWND window, bool state);
  544. HRESULT
  545. EndDialog(HWND dialog, int result);
  546. #undef EnumUILanguages
  547. HRESULT
  548. EnumUILanguages(
  549. UILANGUAGE_ENUMPROCW proc,
  550. DWORD flags,
  551. LONG_PTR lParam);
  552. HRESULT
  553. ExitWindowsEx(UINT options);
  554. // expands strings in s, returns s on failure, expanded version on
  555. // success.
  556. String
  557. ExpandEnvironmentStrings(const String& s);
  558. HRESULT
  559. FindFirstFile(
  560. const String& fileName,
  561. WIN32_FIND_DATA& data,
  562. HANDLE& result);
  563. HRESULT
  564. FindClose(HANDLE& findHandle);
  565. HRESULT
  566. FindNextFile(HANDLE& findHandle, WIN32_FIND_DATA& data);
  567. // Searches the module indicated by GetResourceModuleHandle()
  568. HRESULT
  569. FindResource(PCWSTR name, PCWSTR type, HRSRC& result);
  570. HRESULT
  571. FlushFileBuffers(HANDLE handle);
  572. HRESULT
  573. FrameRect(HDC dc, const RECT& rect, HBRUSH brush);
  574. HRESULT
  575. FreeLibrary(HMODULE& module);
  576. void
  577. FreeSid(PSID sid);
  578. // used to free the result returned by Win::GetTokenInformation
  579. void
  580. FreeTokenInformation(TOKEN_USER* userInfo);
  581. HWND
  582. GetActiveWindow();
  583. // for Windows pre-defined classes.
  584. HRESULT
  585. GetClassInfoEx(const String& className, WNDCLASSEX& info);
  586. HRESULT
  587. GetClassInfoEx(
  588. HINSTANCE hInstance,
  589. const String& className,
  590. WNDCLASSEX& info);
  591. String
  592. GetClassName(HWND window);
  593. String
  594. GetClipboardFormatName(UINT format);
  595. HRESULT
  596. GetClientRect(HWND window, RECT& rect);
  597. HRESULT
  598. GetColorDepth(int& result);
  599. String
  600. GetCommandLine();
  601. // Inserts the command line arguments of the current process into the
  602. // provided list. The list is not cleared beforehand. The list is similar
  603. // to the traditional argv array. Returns the number of args inserted.
  604. //
  605. // Use instead of ::GetCommandLine, ::ComandLineToArgVW.
  606. //
  607. // BackInsertionSequence - any type that supports the construction of
  608. // a back_insert_iterator on itself, and has a value type that can be
  609. // constructed from an PWSTR.
  610. //
  611. // bii - a reference to a back_insert_iterator of the
  612. // BackInsertionSequence template parameter. The simplest way to make
  613. // one of these is to use the back_inserter helper function.
  614. //
  615. // Example:
  616. //
  617. // StringList container;
  618. // int argCount = Win::GetCommandLineArgs(std::back_inserter(container));
  619. //
  620. // StringVector container;
  621. // int argCount = Win::GetCommandLineArgs(std::back_inserter(container));
  622. template <class BackInsertableContainer>
  623. int
  624. GetCommandLineArgs(
  625. std::back_insert_iterator<BackInsertableContainer>& bii)
  626. {
  627. PWSTR* clArgs = 0;
  628. int argCount = 0;
  629. int retval = 0;
  630. clArgs =
  631. ::CommandLineToArgvW(Win::GetCommandLine().c_str(), &argCount);
  632. ASSERT(clArgs);
  633. if (clArgs)
  634. {
  635. for (retval = 0; retval < argCount; retval++)
  636. {
  637. // the container values can be any type that can be constructed
  638. // from PWSTR...
  639. //lint --e(*) lint does not grok back_insert_iterator
  640. *bii++ = clArgs[retval];
  641. }
  642. Win::GlobalFree(clArgs);
  643. }
  644. ASSERT(argCount == retval);
  645. return retval;
  646. }
  647. // HRESULT
  648. // GetComputerNameEx(COMPUTER_NAME_FORMAT format, String& result);
  649. String
  650. GetComputerNameEx(COMPUTER_NAME_FORMAT format);
  651. HRESULT
  652. GetCurrentDirectory(String& result);
  653. HANDLE
  654. GetCurrentProcess();
  655. HRESULT
  656. GetCursorPos(POINT& result);
  657. HRESULT
  658. GetDC(HWND window, HDC& result);
  659. int
  660. GetDeviceCaps(HDC hdc, int index);
  661. HWND
  662. GetDesktopWindow();
  663. HRESULT
  664. GetDiskFreeSpaceEx(
  665. const String& path,
  666. ULARGE_INTEGER& available,
  667. ULARGE_INTEGER& total,
  668. ULARGE_INTEGER* free);
  669. HWND
  670. GetDlgItem(HWND parentDialog, int itemResID);
  671. String
  672. GetDlgItemText(HWND parentDialog, int itemResID);
  673. int
  674. GetDlgItemInt(HWND parentDialog, int itemResID, bool isSigned = false);
  675. UINT
  676. GetDriveType(const String& path);
  677. EncryptedString
  678. GetEncryptedDlgItemText(HWND parentDialog, int itemResID);
  679. String
  680. GetEnvironmentVariable(const String& name);
  681. HRESULT
  682. GetExitCodeProcess(HANDLE hProcess, DWORD& exitCode);
  683. HRESULT
  684. GetFileAttributes(const String& path, DWORD& result);
  685. HRESULT
  686. GetFileSizeEx(HANDLE handle, LARGE_INTEGER& result);
  687. DWORD
  688. GetFileType(HANDLE handle);
  689. // DWORD
  690. // GetLastError();
  691. HRESULT
  692. GetFullPathName(const String& path, String& result);
  693. HRESULT
  694. GetLastErrorAsHresult();
  695. void
  696. GetLocalTime(SYSTEMTIME& time);
  697. HRESULT
  698. GetDateFormat(
  699. const SYSTEMTIME& date,
  700. String& formattedDate,
  701. LCID locale = LOCALE_USER_DEFAULT,
  702. DWORD flags = 0);
  703. HRESULT
  704. GetTimeFormat(
  705. const SYSTEMTIME& time,
  706. String& formattedTime,
  707. LCID locale = LOCALE_USER_DEFAULT,
  708. DWORD flags = 0);
  709. HRESULT
  710. GetLogicalDriveStrings(size_t bufChars, TCHAR* buf, DWORD& result);
  711. HRESULT
  712. GetMailslotInfo(
  713. HANDLE mailslot,
  714. DWORD* maxMessageSize,
  715. DWORD* nextMessageSize,
  716. DWORD* messageCount,
  717. DWORD* readTimeout);
  718. String
  719. GetModuleFileName(HMODULE hModule);
  720. // of this process exe
  721. HINSTANCE
  722. GetModuleHandle();
  723. HWND
  724. GetParent(HWND child);
  725. String
  726. GetPrivateProfileString(
  727. const String& section,
  728. const String& key,
  729. const String& defaultValue,
  730. const String& filename);
  731. HRESULT
  732. GetProcAddress(HMODULE module, const String& procName, FARPROC& result);
  733. HRESULT
  734. GetStringTypeEx(
  735. LCID localeId,
  736. DWORD infoTypeOptions,
  737. const String& sourceString,
  738. WORD* charTypeInfo);
  739. DWORD
  740. GetSysColor(int element);
  741. HBRUSH
  742. GetSysColorBrush(int element);
  743. // returns %systemroot%\system32
  744. String
  745. GetSystemDirectory();
  746. void
  747. GetSystemInfo(SYSTEM_INFO& info);
  748. // returns %systemroot%, always (even under terminal server).
  749. String
  750. GetSystemWindowsDirectory();
  751. // // returns %systemroot%, always
  752. //
  753. // String
  754. // GetSystemRootDirectory();
  755. int
  756. GetSystemMetrics(int index);
  757. #undef GetTempPath
  758. HRESULT
  759. GetTempPath(String& result);
  760. HRESULT
  761. GetTextExtentPoint32(HDC hdc, const String& string, SIZE& size);
  762. HRESULT
  763. GetTextMetrics(HDC hdc, TEXTMETRIC& tm);
  764. // free the result with Win::FreeTokenInformation.
  765. //
  766. // allocates the result and returns it thru userInfo.
  767. HRESULT
  768. GetTokenInformation(HANDLE hToken, TOKEN_USER*& userInfo);
  769. // ... other varations of GetTokenInformation could be defined for
  770. // other infomation classes...
  771. // trims off leading and trailing whitespace
  772. String
  773. GetTrimmedDlgItemText(HWND parentDialog, int itemResID);
  774. // trims off leading and trailing whitespace
  775. String
  776. GetTrimmedWindowText(HWND window);
  777. HRESULT
  778. GetVersionEx(OSVERSIONINFO& info);
  779. HRESULT
  780. GetVersionEx(OSVERSIONINFOEX& info);
  781. HRESULT
  782. GetVolumeInformation(
  783. const String& volume,
  784. String* name,
  785. DWORD* serialNumber,
  786. DWORD* maxFilenameLength,
  787. DWORD* flags,
  788. String* fileSystemName);
  789. HRESULT
  790. GetWindowDC(HWND window, HDC& result);
  791. #undef GetWindowFont
  792. HFONT
  793. GetWindowFont(HWND window);
  794. HRESULT
  795. GetWindowPlacement(HWND window, WINDOWPLACEMENT& placement);
  796. HRESULT
  797. GetWindowRect(HWND window, RECT& rect);
  798. // returns %windir%, which may vary for terminal server users.
  799. String
  800. GetWindowsDirectory();
  801. #undef GetWindowLong
  802. HRESULT
  803. GetWindowLong(HWND window, int index, LONG& result);
  804. #undef GetWindowLongPtr
  805. HRESULT
  806. GetWindowLongPtr(HWND window, int index, LONG_PTR& result);
  807. String
  808. GetWindowText(HWND window);
  809. HRESULT
  810. GlobalAlloc(UINT flags, size_t bytes, HGLOBAL& result);
  811. HRESULT
  812. GlobalFree(HGLOBAL mem);
  813. HRESULT
  814. GlobalLock(HGLOBAL mem, PVOID& result);
  815. HRESULT
  816. GlobalUnlock(HGLOBAL mem);
  817. void
  818. HtmlHelp(
  819. HWND caller,
  820. const String& file,
  821. UINT command,
  822. DWORD_PTR data);
  823. #undef ImageList_Add
  824. int
  825. ImageList_Add(HIMAGELIST list, HBITMAP image, HBITMAP mask);
  826. #undef ImageList_AddIcon
  827. int
  828. ImageList_AddIcon(HIMAGELIST list, HICON icon);
  829. #undef ImageList_AddMasked
  830. int
  831. ImageList_AddMasked(HIMAGELIST list, HBITMAP bitmap, COLORREF mask);
  832. HIMAGELIST
  833. ImageList_Create(
  834. int pixelsx,
  835. int pixelsy,
  836. UINT flags,
  837. int initialSize,
  838. int reserve);
  839. HRESULT
  840. InitializeSecurityDescriptor(SECURITY_DESCRIPTOR& sd);
  841. LONG
  842. InterlockedDecrement(LONG& addend);
  843. LONG
  844. InterlockedIncrement(LONG& addend);
  845. bool
  846. IsDlgButtonChecked(HWND parentDialog, int buttonResID);
  847. // returns true if the name matches one of the local computer's names
  848. // (case insensitive)
  849. bool
  850. IsLocalComputer(const String& computerName);
  851. bool
  852. IsWindow(HWND candidate);
  853. bool
  854. IsWindowEnabled(HWND window);
  855. #undef ListBox_AddString
  856. int
  857. ListBox_AddString(HWND box, const String& s);
  858. #undef ListBox_SetItemData
  859. int
  860. ListBox_SetItemData(HWND box, int index, LPARAM value);
  861. #undef ListBox_GetItemData
  862. LPARAM
  863. ListBox_GetItemData(HWND box, int index);
  864. #undef ListBox_SetCurSel
  865. int
  866. ListBox_SetCurSel(HWND box, int index);
  867. #undef ListBox_GetCurSel
  868. int
  869. ListBox_GetCurSel(HWND box);
  870. #undef ListView_DeleteAllItems
  871. bool
  872. ListView_DeleteAllItems(HWND listview);
  873. #undef ListView_DeleteItem
  874. bool
  875. ListView_DeleteItem(HWND listview, int item);
  876. #undef ListView_GetItem
  877. bool
  878. ListView_GetItem(HWND listview, LVITEM& item);
  879. #undef ListView_GetItemCount
  880. int
  881. ListView_GetItemCount(HWND listview);
  882. #undef ListView_GetItemState
  883. UINT
  884. ListView_GetItemState(HWND listview, int index, UINT mask);
  885. #undef ListView_GetSelectedCount
  886. int
  887. ListView_GetSelectedCount(HWND listview);
  888. #undef ListView_GetSelectionMark
  889. int
  890. ListView_GetSelectionMark(HWND listview);
  891. #undef ListView_InsertColumn
  892. int
  893. ListView_InsertColumn(HWND listview, int index, const LVCOLUMN& column);
  894. #undef ListView_InsertItem
  895. int
  896. ListView_InsertItem(HWND listview, const LVITEM& item);
  897. #undef ListView_SetColumnWidth
  898. bool
  899. ListView_SetColumnWidth(HWND listview, int col, int cx);
  900. #undef ListView_SetExtendedListViewStyle
  901. // Our version returns the previous extended styles
  902. DWORD
  903. ListView_SetExtendedListViewStyle(HWND listview, DWORD exStyle);
  904. #undef ListView_SetExtendedListViewStyleEx
  905. // Our version returns the previous extended styles
  906. DWORD
  907. ListView_SetExtendedListViewStyleEx(
  908. HWND listview,
  909. DWORD mask,
  910. DWORD exStyle);
  911. #undef ListView_SetImageList
  912. HIMAGELIST
  913. ListView_SetImageList(HWND listview, HIMAGELIST images, int type);
  914. #undef ListView_SetItem
  915. void
  916. ListView_SetItem(HWND listview, const LVITEM& item);
  917. #undef ListView_SetItemText
  918. void
  919. ListView_SetItemText(
  920. HWND listview,
  921. int item,
  922. int subItem,
  923. const String& text);
  924. #undef ListView_SetItemState
  925. void
  926. ListView_SetItemState(
  927. HWND listview,
  928. int item,
  929. UINT state,
  930. UINT mask);
  931. HRESULT
  932. LoadBitmap(unsigned resId, HBITMAP& result);
  933. HRESULT
  934. LoadCursor(const String& cursorName, HCURSOR& result);
  935. // provided for MAKEINTRESOURCE versions of cursorName
  936. HRESULT
  937. LoadCursor(
  938. const TCHAR* cursorName,
  939. HCURSOR& result,
  940. bool isSystemCursor = true);
  941. HRESULT
  942. LoadIcon(int resID, HICON& result);
  943. HRESULT
  944. LoadImage(unsigned resID, unsigned type, HANDLE& result);
  945. HRESULT
  946. LoadImage(unsigned resID, HICON& result);
  947. HRESULT
  948. LoadImage(unsigned resID, HBITMAP& result);
  949. HRESULT
  950. LoadLibrary(const String& libFileName, HINSTANCE& result);
  951. HRESULT
  952. LoadLibraryEx(const String& libFileName, DWORD flags, HINSTANCE& result);
  953. HRESULT
  954. LoadMenu(unsigned resID, HMENU& result);
  955. // Loads from the module indicated by GetResourceModuleHandle()
  956. HRESULT
  957. LoadResource(HRSRC handle, HGLOBAL& result);
  958. // Loads from the module indicated by GetResourceModuleHandle()
  959. String
  960. LoadString(unsigned resID);
  961. String
  962. LoadString(unsigned resID, HINSTANCE hInstance);
  963. HRESULT
  964. LocalFree(HLOCAL mem);
  965. HRESULT
  966. LookupAccountSid(
  967. const String& machineName,
  968. PSID sid,
  969. String& accountName,
  970. String& domainName);
  971. #undef LookupPrivilegeValue
  972. HRESULT
  973. LookupPrivilegeValue(
  974. const TCHAR* systemName,
  975. const TCHAR* privName,
  976. LUID& luid);
  977. // if you pass 0 for from, then this will convert from screen coords
  978. HRESULT
  979. MapWindowPoints(
  980. HWND from,
  981. HWND to,
  982. RECT& rect,
  983. int* dh = 0, // number of pixels added to horizontal coord
  984. int* dv = 0); // number of pixels added to vertical coord
  985. int
  986. MessageBox(
  987. HWND owner,
  988. const String& text,
  989. const String& title,
  990. UINT flags);
  991. HRESULT
  992. MoveFileEx(
  993. const String& srcPath,
  994. const String& dstPath,
  995. DWORD flags);
  996. HRESULT
  997. MoveWindow(
  998. HWND window,
  999. int x,
  1000. int y,
  1001. int width,
  1002. int height,
  1003. bool shouldRepaint);
  1004. HRESULT
  1005. OpenProcessToken(
  1006. HANDLE processHandle,
  1007. DWORD desiredAccess,
  1008. HANDLE& tokenHandle);
  1009. HRESULT
  1010. OpenSCManager(
  1011. const String& machine,
  1012. DWORD desiredAccess,
  1013. SC_HANDLE& result);
  1014. HRESULT
  1015. OpenService(
  1016. SC_HANDLE managerHandle,
  1017. const String& serviceName,
  1018. DWORD desiredAccess,
  1019. SC_HANDLE& result);
  1020. HRESULT
  1021. ChangeServiceConfig(
  1022. SC_HANDLE serviceHandle,
  1023. DWORD serviceType,
  1024. DWORD serviceStartType,
  1025. DWORD errorControl,
  1026. const String& binaryPath,
  1027. const String& loadOrderingGroup,
  1028. DWORD* tagID,
  1029. const String& dependencies,
  1030. const String& accountName,
  1031. EncryptedString& password,
  1032. const String& displayName);
  1033. void
  1034. OutputDebugString(const String& string);
  1035. HRESULT
  1036. PeekNamedPipe(
  1037. HANDLE pipe,
  1038. void* buffer,
  1039. DWORD bufferSize,
  1040. DWORD* bytesRead,
  1041. DWORD* bytesAvailable,
  1042. DWORD* bytesRemainingThisMessage);
  1043. HRESULT
  1044. PostMessage(HWND window, UINT msg, WPARAM wParam, LPARAM lParam);
  1045. HRESULT
  1046. PropertySheet(PROPSHEETHEADER* header, INT_PTR& result);
  1047. #undef PropSheet_Changed
  1048. void
  1049. PropSheet_Changed(HWND propSheet, HWND page);
  1050. #undef PropSheet_Unchanged
  1051. void
  1052. PropSheet_Unchanged(HWND propSheet, HWND page);
  1053. #undef PropSheet_RebootSystem
  1054. void
  1055. PropSheet_RebootSystem(HWND propSheet);
  1056. #undef PropSheet_SetTitle
  1057. void
  1058. PropSheet_SetTitle(
  1059. HWND propSheet,
  1060. DWORD style,
  1061. const String& title);
  1062. #undef PropSheet_SetHeaderSubTitle
  1063. void
  1064. PropSheet_SetHeaderSubTitle(
  1065. HWND propSheet,
  1066. int pageIndex,
  1067. const String& subTitle);
  1068. #undef PropSheet_SetWizButtons
  1069. void
  1070. PropSheet_SetWizButtons(HWND propSheet, DWORD buttonFlags);
  1071. #undef PropSheet_PressButton
  1072. void
  1073. PropSheet_PressButton(HWND propSheet, DWORD buttonID);
  1074. #undef PropSheet_HwndToIndex
  1075. int
  1076. PropSheet_HwndToIndex(
  1077. HWND propSheet,
  1078. HWND page);
  1079. #undef PropSheet_IdToIndex
  1080. int
  1081. PropSheet_IdToIndex(
  1082. HWND propSheet,
  1083. int pageId);
  1084. HRESULT
  1085. QueryServiceStatus(
  1086. SC_HANDLE handle,
  1087. SERVICE_STATUS& status);
  1088. HRESULT
  1089. ReadFile(
  1090. HANDLE file,
  1091. void* buffer,
  1092. DWORD bytesToRead,
  1093. DWORD& bytesRead,
  1094. OVERLAPPED* overlapped);
  1095. void
  1096. ReleaseStgMedium(STGMEDIUM& medium);
  1097. HRESULT
  1098. RegCloseKey(HKEY hKey);
  1099. HRESULT
  1100. RegConnectRegistry(
  1101. const String& machine,
  1102. HKEY hKey,
  1103. HKEY& result);
  1104. HRESULT
  1105. RegCreateKeyEx(
  1106. HKEY hKey,
  1107. const String& subkeyName,
  1108. DWORD options,
  1109. REGSAM access,
  1110. SECURITY_ATTRIBUTES* securityAttrs,
  1111. HKEY& result,
  1112. DWORD* disposition);
  1113. HRESULT
  1114. RegDeleteValue(
  1115. HKEY hKey,
  1116. const String& valueName);
  1117. HRESULT
  1118. RegOpenKeyEx(
  1119. HKEY hKey,
  1120. const String& subKey,
  1121. REGSAM accessDesired,
  1122. HKEY& result);
  1123. HRESULT
  1124. RegQueryValueEx(
  1125. HKEY hKey,
  1126. const String& valueName,
  1127. DWORD* type,
  1128. BYTE* data,
  1129. DWORD* dataSize);
  1130. // You should really use the Registry class -- it's typesafe.
  1131. HRESULT
  1132. RegSetValueEx(
  1133. HKEY hKey,
  1134. const String& valueName,
  1135. DWORD type,
  1136. const BYTE* data,
  1137. size_t dataSizeInBytes);
  1138. HRESULT
  1139. RegisterClassEx(const WNDCLASSEX& wndclass, ATOM& result);
  1140. CLIPFORMAT
  1141. RegisterClipboardFormat(const String& name);
  1142. void
  1143. ReleaseDC(HWND window, HDC dc);
  1144. HRESULT
  1145. ReleaseMutex(HANDLE mutex);
  1146. HRESULT
  1147. RemoveDirectory(const String& path);
  1148. inline
  1149. HRESULT
  1150. RemoveFolder(const String& path)
  1151. {
  1152. return Win::RemoveDirectory(path);
  1153. }
  1154. HRESULT
  1155. ResetEvent(HANDLE event);
  1156. // Returns the previous mask.
  1157. DWORD
  1158. RichEdit_SetEventMask(HWND richEdit, DWORD mask);
  1159. void
  1160. RichEdit_GetSel(
  1161. HWND richEdit,
  1162. CHARRANGE& range);
  1163. // returns the number of bytes streamed
  1164. int
  1165. RichEdit_StreamIn(
  1166. HWND richEdit,
  1167. WPARAM formatOptions,
  1168. EDITSTREAM& editStream);
  1169. int
  1170. RichEdit_SetRtfText(HWND richEdit, DWORD flags, const String& rtfText);
  1171. void
  1172. RichEdit_SetSel(
  1173. HWND richEdit,
  1174. const CHARRANGE& range);
  1175. int
  1176. RichEdit_SetText(HWND richEdit, DWORD flags, const String& text);
  1177. bool
  1178. RichEdit_SetCharacterFormat(
  1179. HWND richEdit,
  1180. DWORD options,
  1181. CHARFORMAT2& format);
  1182. HRESULT
  1183. ScreenToClient(HWND window, POINT& point);
  1184. HRESULT
  1185. ScreenToClient(HWND window, RECT& rect);
  1186. HGDIOBJ
  1187. SelectObject(HDC hdc, HGDIOBJ hobject);
  1188. LRESULT
  1189. SendMessage(HWND window, UINT msg, WPARAM wParam, LPARAM lParam);
  1190. HRESULT
  1191. SetComputerNameEx(COMPUTER_NAME_FORMAT format, const String& newName);
  1192. HRESULT
  1193. SetCurrentDirectory(const String& path);
  1194. HCURSOR
  1195. SetCursor(HCURSOR newCursor);
  1196. HRESULT
  1197. SetDlgItemText(
  1198. HWND parentDialog,
  1199. int itemResID,
  1200. const String& text);
  1201. inline
  1202. HRESULT
  1203. SetDlgItemText(
  1204. HWND parentDialog,
  1205. int itemResID,
  1206. int textResID)
  1207. {
  1208. return
  1209. Win::SetDlgItemText(
  1210. parentDialog,
  1211. itemResID,
  1212. String::load(textResID));
  1213. }
  1214. HRESULT
  1215. SetDlgItemText(
  1216. HWND parentDialog,
  1217. int itemResID,
  1218. const EncryptedString& cypherText);
  1219. HRESULT
  1220. SetEntriesInAcl(
  1221. ULONG countOfEntries,
  1222. EXPLICIT_ACCESS eaArray[],
  1223. PACL& result);
  1224. HRESULT
  1225. SetEvent(HANDLE event);
  1226. HRESULT
  1227. SetFileAttributes(const String& path, DWORD newAttrs);
  1228. HRESULT
  1229. SetFilePointerEx(
  1230. HANDLE handle,
  1231. const LARGE_INTEGER& distanceToMove,
  1232. LARGE_INTEGER* newPosition,
  1233. DWORD moveMethod);
  1234. HRESULT
  1235. SetFileSecurity(
  1236. const String& path,
  1237. SECURITY_INFORMATION si,
  1238. const SECURITY_DESCRIPTOR& sd);
  1239. HWND
  1240. SetFocus(HWND window);
  1241. bool
  1242. SetForegroundWindow(HWND window);
  1243. // ISSUE-2002/04/23-sburns This version is silly: daclPresent and
  1244. // daclDefaulted are always the same.
  1245. HRESULT
  1246. SetSecurityDescriptorDacl(
  1247. SECURITY_DESCRIPTOR& sd,
  1248. bool daclPresent,
  1249. ACL& dacl, // ref to prevent null dacl
  1250. bool daclDefaulted);
  1251. HRESULT
  1252. SetSecurityDescriptorDacl(
  1253. SECURITY_DESCRIPTOR& sd,
  1254. ACL& dacl); // ref to prevent null dacl
  1255. HRESULT
  1256. SetSecurityDescriptorOwner(SECURITY_DESCRIPTOR& sd, SID* ownerSid);
  1257. #undef SetWindowFont
  1258. void
  1259. SetWindowFont(HWND window, HFONT font, bool redraw);
  1260. #undef SetWindowLong
  1261. HRESULT
  1262. SetWindowLong(
  1263. HWND window,
  1264. int index,
  1265. LONG value,
  1266. LONG* oldValue = 0);
  1267. #undef SetWindowLongPtr
  1268. HRESULT
  1269. SetWindowLongPtr(
  1270. HWND window,
  1271. int index,
  1272. LONG_PTR value,
  1273. LONG_PTR* oldValue = 0);
  1274. HRESULT
  1275. SetWindowPos(
  1276. HWND window,
  1277. HWND insertAfter,
  1278. int x,
  1279. int y,
  1280. int width,
  1281. int height,
  1282. UINT flags);
  1283. HRESULT
  1284. SetWindowText(HWND window, const String& text);
  1285. LPITEMIDLIST
  1286. SHBrowseForFolder(BROWSEINFO& bi);
  1287. HRESULT
  1288. SHGetMalloc(LPMALLOC& pMalloc);
  1289. String
  1290. SHGetPathFromIDList(LPCITEMIDLIST pidl);
  1291. HRESULT
  1292. SHGetSpecialFolderLocation(
  1293. HWND hwndOwner,
  1294. int nFolder,
  1295. LPITEMIDLIST& pidl);
  1296. void
  1297. ShowWindow(HWND window, int swOption);
  1298. HRESULT
  1299. SizeofResource(HRSRC handle, DWORD& result);
  1300. // 'Spin' is a synonym for 'Up-Down' control
  1301. void
  1302. Spin_GetRange(HWND spinControl, int* low, int* high);
  1303. void
  1304. Spin_SetRange(HWND spinControl, int low, int high);
  1305. int
  1306. Spin_GetPosition(HWND spinControl);
  1307. void
  1308. Spin_SetPosition(HWND spinControl, int position);
  1309. #undef Static_SetIcon
  1310. void
  1311. Static_SetIcon(HWND staticText, HICON icon);
  1312. String
  1313. StringFromCLSID(const CLSID& clsID);
  1314. // inline synonym
  1315. inline
  1316. String
  1317. CLSIDToString(const CLSID& clsID)
  1318. {
  1319. return StringFromCLSID(clsID);
  1320. }
  1321. String
  1322. StringFromGUID2(const GUID& guid);
  1323. // inline synonym
  1324. inline
  1325. String
  1326. GUIDToString(const GUID& guid)
  1327. {
  1328. return StringFromGUID2(guid);
  1329. }
  1330. HRESULT
  1331. SystemParametersInfo(
  1332. UINT action,
  1333. UINT param,
  1334. void* vParam,
  1335. UINT WinIni);
  1336. HRESULT
  1337. TlsAlloc(DWORD& result);
  1338. HRESULT
  1339. TlsFree(DWORD index);
  1340. HRESULT
  1341. TlsSetValue(DWORD index, PVOID value);
  1342. HRESULT
  1343. TlsGetValue(DWORD index, PVOID& result);
  1344. HRESULT
  1345. UpdateWindow(HWND winder);
  1346. bool
  1347. ToolTip_AddTool(HWND toolTip, TOOLINFO& info);
  1348. bool
  1349. ToolTip_GetToolInfo(HWND toolTip, TOOLINFO& info);
  1350. bool
  1351. ToolTip_SetTitle(HWND toolTip, int icon, const String& title);
  1352. void
  1353. ToolTip_TrackActivate(HWND toolTip, bool activate, TOOLINFO& info);
  1354. void
  1355. ToolTip_TrackPosition(HWND toolTip, int xPos, int yPos);
  1356. HRESULT
  1357. UnregisterClass(const String& classname, HINSTANCE module);
  1358. HRESULT
  1359. WaitForSingleObject(
  1360. HANDLE object,
  1361. unsigned timeoutMillis,
  1362. DWORD& result);
  1363. HRESULT
  1364. WideCharToMultiByte(
  1365. DWORD flags,
  1366. const String& string,
  1367. char* buffer,
  1368. size_t bufferSize,
  1369. size_t& result);
  1370. HRESULT
  1371. WinHelp(
  1372. HWND window,
  1373. const String& helpFileName,
  1374. UINT command,
  1375. ULONG_PTR data);
  1376. HRESULT
  1377. WriteFile(
  1378. HANDLE handle,
  1379. const void* buffer,
  1380. DWORD numberOfBytesToWrite,
  1381. DWORD* numberOfBytesWritten);
  1382. HRESULT
  1383. WritePrivateProfileString(
  1384. const String& section,
  1385. const String& key,
  1386. const String& value,
  1387. const String& filename);
  1388. }
  1389. } // namespace Burnslib
  1390. #endif // WIN_HPP_INCLUDED