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.

57 lines
1.4 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: w95dci.c
  6. * Content: DCI thunk helper code
  7. * History:
  8. * Date By Reason
  9. * ==== == ======
  10. * 19-jun-95 craige initial implementation
  11. *
  12. ***************************************************************************/
  13. #include "ddrawpr.h"
  14. #include "dpf.h"
  15. #include "memalloc.h"
  16. #include "dciman.h"
  17. extern int WINAPI DCICreatePrimary32( HDC hdc, LPDCISURFACEINFO lpSurface );
  18. extern void WINAPI DCIDestroy32( LPDCISURFACEINFO pdci );
  19. /*
  20. * DCICreatePrimary
  21. */
  22. int WINAPI DCICreatePrimary( HDC hdc, LPDCISURFACEINFO *lplpSurface )
  23. {
  24. int rc;
  25. LPDCISURFACEINFO lpSurface;
  26. *lplpSurface = NULL;
  27. lpSurface = MemAlloc( sizeof( *lpSurface ) );
  28. if( lpSurface == NULL )
  29. {
  30. return DCI_ERR_OUTOFMEMORY;
  31. }
  32. lpSurface->dwSize = sizeof( DCIPRIMARY );
  33. rc = DCICreatePrimary32( hdc, lpSurface );
  34. if( rc < 0 )
  35. {
  36. DPF( 2, "DCICreatePrimary32: rc = %ld", rc );
  37. MemFree( lpSurface );
  38. return rc;
  39. }
  40. *lplpSurface = lpSurface;
  41. return rc;
  42. } /* DCICreatePrimary */
  43. /*
  44. * DCIDestroy
  45. */
  46. void WINAPI DCIDestroy( LPDCISURFACEINFO pdci )
  47. {
  48. DCIDestroy32( pdci );
  49. MemFree( pdci );
  50. } /* DCIDestroy */