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.

43 lines
775 B

  1. #ifdef NT
  2. #include <glos.h>
  3. #endif
  4. #include "gluint.h"
  5. #include <GL/glu.h>
  6. #ifndef NT
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #else
  10. #include "glstring.h"
  11. #endif
  12. DWORD gluMemoryAllocationFailed = 0;
  13. HLOCAL gluAlloc (UINT size)
  14. {
  15. HLOCAL tmp;
  16. tmp = LocalAlloc(LMEM_FIXED, size);
  17. if (tmp == NULL) gluMemoryAllocationFailed++;
  18. return tmp;
  19. }
  20. HLOCAL gluCalloc (UINT nobj, UINT size)
  21. {
  22. HLOCAL tmp;
  23. tmp = LocalAlloc(LMEM_FIXED|LMEM_ZEROINIT, nobj*size);
  24. if (tmp == NULL) gluMemoryAllocationFailed++;
  25. return tmp;
  26. }
  27. HLOCAL gluReAlloc (HLOCAL p, UINT size)
  28. {
  29. HLOCAL tmp;
  30. tmp = LocalReAlloc(p, size, LMEM_MOVEABLE);
  31. if (tmp == NULL) gluMemoryAllocationFailed++;
  32. return tmp;
  33. }