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.

87 lines
2.1 KiB

  1. #ifndef _WINDEF_H__
  2. #define _WINDEF_H__
  3. #include "../../h/props.h"
  4. #include "ntstatus.h" /* status codes */
  5. #ifdef _WIN32
  6. #define WINAPI STDMETHODCALLTYPE
  7. #else
  8. #define WINAPI
  9. #endif
  10. /* these parameter modifiers are for informational purposes only */
  11. #define IN
  12. #define OUT
  13. #define OPTIONAL
  14. #define UNALIGNED
  15. #define CP_WINUNICODE 1200 /* 0x04b0 */
  16. typedef void* PVOID;
  17. typedef PVOID HANDLE;
  18. typedef VOID *NTPROP;
  19. typedef VOID *NTMAPPEDSTREAM;
  20. #define INVALID_HANDLE_VALUE ((HANDLE) -1)
  21. /* no multithread protect in reference implementation as yet */
  22. inline long InterlockedIncrement(long *pulArg)
  23. { return ++(*pulArg); }
  24. inline long InterlockedDecrement(long *pulArg)
  25. { return --(*pulArg); }
  26. /* right now only US ansi support */
  27. EXTERN_C STDAPI_(UINT) GetACP(VOID);
  28. typedef ULONG LCID, *PLCID;
  29. inline LCID GetUserDefaultLCID(void)
  30. {
  31. /* Windows Code Page 1252 :(LANG_ENGLISH,SUBLANG_ENGLISH_US) */
  32. return 0x409;
  33. }
  34. #define CP_ACP 0
  35. #define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0)
  36. #define wsprintfA sprintf
  37. #define wvsprintfA vsprintf
  38. inline void OutputDebugString(LPSTR sz)
  39. {
  40. printf("%s", sz);
  41. }
  42. #include <assert.h>
  43. #define Win4Assert assert
  44. #define TEXT(x) _T(x)
  45. /* memory manupulation routines */
  46. #define RtlCopyMemory(dest,src,count) memcpy(dest, src, count)
  47. #define RtlZeroMemory(dest, len) memset(dest, 0, len)
  48. #define RtlMoveMemory(dest, src, count) memmove(dest, src, count)
  49. #define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field))
  50. #define WINVER 0x400
  51. inline LONG CompareFileTime(
  52. const FILETIME *lpFileTime1, /* pointer to first file time */
  53. const FILETIME *lpFileTime2 /* pointer to second file time */
  54. )
  55. {
  56. LONG ldiff = lpFileTime1->dwHighDateTime - lpFileTime2->dwHighDateTime;
  57. if (ldiff == 0)
  58. ldiff = lpFileTime1->dwLowDateTime - lpFileTime2->dwLowDateTime;
  59. if (ldiff > 0)
  60. ldiff = 1;
  61. else if (ldiff < 0)
  62. ldiff = -1;
  63. return ldiff;
  64. }
  65. #define MAKELONG(a, b) ( (LONG)( ((WORD) (a)) | \
  66. ((DWORD) ((WORD) (b)))<< 16) )
  67. #endif /* _WINDEF_H__ */