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.

80 lines
2.1 KiB

  1. /*
  2. * MSVFW32: (Compman, drawdib and video)
  3. *
  4. * utility functions to read and write values to the profile,
  5. * using win.ini for Win16 or current user\software\microsoft\vfw\...
  6. * in the registry for Win32
  7. */
  8. #define MMPROFILECACHE 0 // Set to 1 to cache keys, 0 otherwise
  9. #ifndef _WIN32
  10. #define mmGetProfileIntA(app, value, default) \
  11. GetProfileInt(app, value, default)
  12. #define mmWriteProfileString(appname, valuename, pData) \
  13. WriteProfileString(appname, valuename, pData)
  14. #define mmGetProfileString(appname, valuename, pDefault, pResult, cbResult) \
  15. GetProfileString(appname, valuename, pDefault, pResult, cbResult)
  16. //#define mmAnsiToWide(lpwsz,lpsz,nChars) (lpsz)
  17. //#define mmWideToAnsi(lpsz,lpwsz,nChars) (lpwsz)
  18. #define CloseKeys()
  19. #else
  20. #ifdef DAYTONA
  21. #undef MMPROFILECACHE
  22. #define MMPROFILECACHE 1 // Set to 1 to cache keys, 0 otherwise
  23. #endif
  24. /*
  25. * read a UINT from the profile, or return default if
  26. * not found.
  27. */
  28. UINT mmGetProfileIntA(LPCSTR appname, LPCSTR valuename, INT uDefault);
  29. /*
  30. * read a string from the profile into pResult.
  31. * result is number of characters written into pResult
  32. */
  33. DWORD mmGetProfileString(LPCTSTR appname, LPCTSTR valuename, LPCTSTR pDefault,
  34. LPTSTR pResult, int cbResult
  35. );
  36. /*
  37. * write a string to the profile
  38. */
  39. VOID mmWriteProfileString(LPCTSTR appname, LPCTSTR valuename, LPCTSTR pData);
  40. #if MMPROFILECACHE
  41. VOID CloseKeys(VOID);
  42. #else
  43. #define CloseKeys()
  44. #endif
  45. /*
  46. * convert an Ansi string to Wide characters
  47. */
  48. LPWSTR mmAnsiToWide (
  49. LPWSTR lpwsz, // out: wide char buffer to convert into
  50. LPCSTR lpsz, // in: ansi string to convert from
  51. UINT nChars); // in: count of characters in each buffer
  52. /*
  53. * convert a Wide char string to Ansi
  54. */
  55. LPSTR mmWideToAnsi (
  56. LPSTR lpsz, // out: ansi buffer to convert into
  57. LPCWSTR lpwsz, // in: wide char buffer to convert from
  58. UINT nChars); // in: count of characters (not bytes!)
  59. #if !defined NUMELMS
  60. #define NUMELMS(aa) (sizeof(aa)/sizeof((aa)[0]))
  61. #endif
  62. #endif