Subject: Re: bug#6989: 24.0.50; w32.c:99: error: redefinition of `struct _PROCESS_MEMORY_COUNTERS_EX'

From: Stephen Powell <[email-masked]>
Date: Tue, 07 Sep 2010 10:41:48 +0100

Eli Zaretskii <[email-masked]> writes:

> Thanks.  One more question: is it true that w32api 3.14 didn't have
> this typedef in psapi.h, and 3.15 introduced it?

According to the cvs log the upstream change was introduced here
<http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/w32api/ChangeLog?rev=1.1055&cvsroot=src>
:

2010-06-28 Rick Rankin <[email-masked]>

	* include/psapi.h (PROCESS_MEMORY_COUNTERS_EX, PERFORMANCE_INFORMATION,
	GetPerformanceInfo): Define.
	* lib/psapi.def (GetPerformanceInfo): Define.
	* include/wincrypt.h (CryptEnumProvidersA, CryptEnumProvidersW,
	CryptEnumProviders): Define.

The diff of the two versions:

--8<---------------cut here---------------start------------->8---
*** c:/temp/w32api-3.14-1/include/psapi.h	2008-01-30 07:34:43.000000000
+1100
--- c:/cygwin/usr/include/w32api/psapi.h	2010-08-28 10:11:17.001000000 +1000
***************
*** 50,55 ****
--- 50,86 ----
  	DWORD PeakPagefileUsage;
  } PROCESS_MEMORY_COUNTERS,*PPROCESS_MEMORY_COUNTERS;

+ typedef struct _PROCESS_MEMORY_COUNTERS_EX {
+ 	DWORD cb;
+ 	DWORD PageFaultCount;
+ 	DWORD PeakWorkingSetSize;
+ 	DWORD WorkingSetSize;
+ 	DWORD QuotaPeakPagedPoolUsage;
+ 	DWORD QuotaPagedPoolUsage;
+ 	DWORD QuotaPeakNonPagedPoolUsage;
+ 	DWORD QuotaNonPagedPoolUsage;
+ 	DWORD PagefileUsage;
+ 	DWORD PeakPagefileUsage;
+ 	DWORD PrivateUsage;
+ } PROCESS_MEMORY_COUNTERS_EX,*PPROCESS_MEMORY_COUNTERS_EX;
+
+ typedef struct _PERFORMANCE_INFORMATION {
+   DWORD cb;
+   DWORD CommitTotal;
+   DWORD CommitLimit;
+   DWORD CommitPeak;
+   DWORD PhysicalTotal;
+   DWORD PhysicalAvailable;
+   DWORD SystemCache;
+   DWORD KernelTotal;
+   DWORD KernelPaged;
+   DWORD KernelNonpaged;
+   DWORD PageSize;
+   DWORD HandleCount;
+   DWORD ProcessCount;
+   DWORD ThreadCount;
+ } PERFORMANCE_INFORMATION, *PPERFORMANCE_INFORMATION;
+
  /* Grouped by application,not in alphabetical order. */
  BOOL WINAPI EnumProcesses(DWORD *,DWORD,DWORD *);
  BOOL WINAPI EnumProcessModules(HANDLE,HMODULE *,DWORD,LPDWORD);
***************
*** 70,75 ****
--- 101,107 ----
  DWORD WINAPI GetDeviceDriverFileNameA(LPVOID,LPSTR,DWORD);
  DWORD WINAPI GetDeviceDriverFileNameW(LPVOID,LPWSTR,DWORD);
  BOOL WINAPI GetProcessMemoryInfo(HANDLE,PPROCESS_MEMORY_COUNTERS,DWORD);
+ BOOL WINAPI GetPerformanceInfo(PPERFORMANCE_INFORMATION,DWORD);
  #if (_WIN32_WINNT >= 0x0501)
  DWORD WINAPI GetProcessImageFileNameA(HANDLE,LPSTR,DWORD);
  DWORD WINAPI GetProcessImageFileNameW(HANDLE,LPWSTR,DWORD);
--8<---------------cut here---------------end--------------->8---