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.

58 lines
1.9 KiB

  1. /***
  2. *getpid.c - get current process id
  3. *
  4. * Copyright (c) 1989-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Defines _getpid() - get current process id
  8. *
  9. *Revision History:
  10. * 06-06-89 PHG Module created, based on asm version
  11. * 10-27-89 JCR Added new Dos32GetThreadInfo code (under DCR757 switch)
  12. * 11-17-89 JCR Enabled DOS32GETTHREADINFO code (DCR757)
  13. * 03-07-90 GJF Made calling type _CALLTYPE1, added #include
  14. * <cruntime.h> and fixed copyright. Also, cleaned up the
  15. * formatting a bit.
  16. * 07-02-90 GJF Removed pre-DCR757 stuff.
  17. * 08-08-90 GJF Changed API prefix from DOS32 to DOS
  18. * 10-03-90 GJF New-style function declarator.
  19. * 12-04-90 SRW Changed to include <oscalls.h> instead of <doscalls.h>
  20. * 12-06-90 SRW Added _CRUISER_ and _WIN32 conditionals.
  21. * 01-28-91 GJF ANSI naming.
  22. * 04-06-93 SKS Replace _CRTAPI* with __cdecl
  23. * 09-06-94 CFW Remove Cruiser support.
  24. * 02-06-92 CFW assert.h removed. (Mac version only)
  25. * 02-08-95 JWM Spliced _WIN32 & Mac versions.
  26. * 07-01-96 GJF Replaced defined(_WIN32) with !defined(_MAC). Also,
  27. * detab-ed and cleaned up the format a bit.
  28. * 05-17-99 PML Remove all Macintosh support.
  29. *
  30. *******************************************************************************/
  31. #include <cruntime.h>
  32. #include <oscalls.h>
  33. /***
  34. *int _getpid() - get current process id
  35. *
  36. *Purpose:
  37. * Returns the current process id for the calling process.
  38. *
  39. *Entry:
  40. * None.
  41. *
  42. *Exit:
  43. * Returns the current process id.
  44. *
  45. *Uses:
  46. *
  47. *Exceptions:
  48. *
  49. *******************************************************************************/
  50. int __cdecl _getpid (
  51. void
  52. )
  53. {
  54. return GetCurrentProcessId();
  55. }