[Com0com-cvs] com0com/sys adddev.c, 1.23, 1.24 bufutils.c, 1.7, 1.8 delay.c, 1.4, 1.5 ioctl.c, 1.26
The virtual serial port driver for Windows.
Brought to you by:
vfrolov
From: Vyacheslav F. <vf...@us...> - 2007-01-11 14:50:40
|
Update of /cvsroot/com0com/com0com/sys In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv9876 Modified Files: adddev.c bufutils.c delay.c ioctl.c openclos.c pnp.c strutils.c Log Message: Pool functions replaced by C0C_ALLOCATE_POOL() C0C_ALLOCATE_POOL_WITH_QUOTA() C0C_FREE_POOL() Index: bufutils.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/bufutils.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** bufutils.c 21 Jun 2006 16:23:57 -0000 1.7 --- bufutils.c 11 Jan 2007 14:50:29 -0000 1.8 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2004-2006 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2004-2007 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,29 ---- * * $Log$ + * Revision 1.8 2007/01/11 14:50:29 vfrolov + * Pool functions replaced by + * C0C_ALLOCATE_POOL() + * C0C_ALLOCATE_POOL_WITH_QUOTA() + * C0C_FREE_POOL() + * * Revision 1.7 2006/06/21 16:23:57 vfrolov * Fixed possible BSOD after one port of pair removal *************** *** 445,449 **** if (size <= C0C_BUFFER_SIZE(pBuf)) { ! ExFreePool(pBase); return FALSE; } --- 451,455 ---- if (size <= C0C_BUFFER_SIZE(pBuf)) { ! C0C_FREE_POOL(pBase); return FALSE; } *************** *** 472,476 **** } ! ExFreePool(pBuf->pBase); } --- 478,482 ---- } ! C0C_FREE_POOL(pBuf->pBase); } *************** *** 501,505 **** { if (pBuf->pBase) ! ExFreePool(pBuf->pBase); RtlZeroMemory(pBuf, sizeof(*pBuf)); --- 507,511 ---- { if (pBuf->pBase) ! C0C_FREE_POOL(pBuf->pBase); RtlZeroMemory(pBuf, sizeof(*pBuf)); Index: openclos.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/openclos.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** openclos.c 23 Jun 2006 11:44:52 -0000 1.15 --- openclos.c 11 Jan 2007 14:50:29 -0000 1.16 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2004-2006 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2004-2007 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,29 ---- * * $Log$ + * Revision 1.16 2007/01/11 14:50:29 vfrolov + * Pool functions replaced by + * C0C_ALLOCATE_POOL() + * C0C_ALLOCATE_POOL_WITH_QUOTA() + * C0C_FREE_POOL() + * * Revision 1.15 2006/06/23 11:44:52 vfrolov * Mass replacement pDevExt by pIoPort *************** *** 93,107 **** case MmLargeSystem: size = 4096; ! pBase = (PUCHAR)ExAllocatePool(NonPagedPool, size); if (pBase) break; case MmMediumSystem: size = 1024; ! pBase = (PUCHAR)ExAllocatePool(NonPagedPool, size); if (pBase) break; case MmSmallSystem: size = 128; ! pBase = (PUCHAR)ExAllocatePool(NonPagedPool, size); if (pBase) break; --- 99,113 ---- case MmLargeSystem: size = 4096; ! pBase = (PUCHAR)C0C_ALLOCATE_POOL(NonPagedPool, size); if (pBase) break; case MmMediumSystem: size = 1024; ! pBase = (PUCHAR)C0C_ALLOCATE_POOL(NonPagedPool, size); if (pBase) break; case MmSmallSystem: size = 128; ! pBase = (PUCHAR)C0C_ALLOCATE_POOL(NonPagedPool, size); if (pBase) break; Index: ioctl.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/ioctl.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ioctl.c 23 Aug 2006 13:16:50 -0000 1.26 --- ioctl.c 11 Jan 2007 14:50:29 -0000 1.27 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2004-2006 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2004-2007 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,29 ---- * * $Log$ + * Revision 1.27 2007/01/11 14:50:29 vfrolov + * Pool functions replaced by + * C0C_ALLOCATE_POOL() + * C0C_ALLOCATE_POOL_WITH_QUOTA() + * C0C_FREE_POOL() + * * Revision 1.26 2006/08/23 13:16:50 vfrolov * Moved code for IOCTL_SERIAL_GET_PROPERTIES to commprop.c *************** *** 613,617 **** try { ! pBase = ExAllocatePoolWithQuota(NonPagedPool, pSysBuf->InSize); } except (EXCEPTION_EXECUTE_HANDLER) { pBase = NULL; --- 619,623 ---- try { ! pBase = C0C_ALLOCATE_POOL_WITH_QUOTA(NonPagedPool, pSysBuf->InSize); } except (EXCEPTION_EXECUTE_HANDLER) { pBase = NULL; Index: strutils.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/strutils.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** strutils.c 3 Nov 2006 13:13:26 -0000 1.3 --- strutils.c 11 Jan 2007 14:50:29 -0000 1.4 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2004-2006 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2004-2007 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,29 ---- * * $Log$ + * Revision 1.4 2007/01/11 14:50:29 vfrolov + * Pool functions replaced by + * C0C_ALLOCATE_POOL() + * C0C_ALLOCATE_POOL_WITH_QUOTA() + * C0C_FREE_POOL() + * * Revision 1.3 2006/11/03 13:13:26 vfrolov * CopyStrW() now gets size in characters (not in bytes) *************** *** 79,83 **** len = (ULONG)(pStrTmp - pStr) * sizeof(WCHAR); ! pStrTmp = (PWCHAR)ExAllocatePool(PagedPool, len); if (!pStrTmp) --- 85,89 ---- len = (ULONG)(pStrTmp - pStr) * sizeof(WCHAR); ! pStrTmp = (PWCHAR)C0C_ALLOCATE_POOL(PagedPool, len); if (!pStrTmp) *************** *** 93,97 **** { if (pDest->Buffer) ! ExFreePool(pDest->Buffer); RtlZeroMemory(pDest, sizeof(*pDest)); } --- 99,103 ---- { if (pDest->Buffer) ! C0C_FREE_POOL(pDest->Buffer); RtlZeroMemory(pDest, sizeof(*pDest)); } *************** *** 128,132 **** if (pDest->MaximumLength == (old.Length + lenSrc)) ! pDest->Buffer = ExAllocatePool(PagedPool, pDest->MaximumLength + sizeof(WCHAR)); if (pDest->Buffer) { --- 134,138 ---- if (pDest->MaximumLength == (old.Length + lenSrc)) ! pDest->Buffer = C0C_ALLOCATE_POOL(PagedPool, pDest->MaximumLength + sizeof(WCHAR)); if (pDest->Buffer) { *************** *** 136,140 **** PWCHAR pSrc0; ! pSrc0 = ExAllocatePool(PagedPool, lenSrc + sizeof(WCHAR)); if (pSrc0) { --- 142,146 ---- PWCHAR pSrc0; ! pSrc0 = C0C_ALLOCATE_POOL(PagedPool, lenSrc + sizeof(WCHAR)); if (pSrc0) { *************** *** 144,148 **** status = RtlAppendUnicodeToString(pDest, pSrc0); ! ExFreePool(pSrc0); } else status = STATUS_INSUFFICIENT_RESOURCES; --- 150,154 ---- status = RtlAppendUnicodeToString(pDest, pSrc0); ! C0C_FREE_POOL(pSrc0); } else status = STATUS_INSUFFICIENT_RESOURCES; *************** *** 154,158 **** if (old.Buffer) ! ExFreePool(old.Buffer); *pStatus = status; --- 160,164 ---- if (old.Buffer) ! C0C_FREE_POOL(old.Buffer); *pStatus = status; *************** *** 210,214 **** PWCHAR pStrTmp; ! pStrTmp = (PWCHAR)ExAllocatePool(PagedPool, len); if (pStrTmp) { --- 216,220 ---- PWCHAR pStrTmp; ! pStrTmp = (PWCHAR)C0C_ALLOCATE_POOL(PagedPool, len); if (pStrTmp) { *************** *** 222,226 **** StrAppendStr0(&status, pDest, pStrTmp); ! ExFreePool(pStrTmp); } else { status = STATUS_INSUFFICIENT_RESOURCES; --- 228,232 ---- StrAppendStr0(&status, pDest, pStrTmp); ! C0C_FREE_POOL(pStrTmp); } else { status = STATUS_INSUFFICIENT_RESOURCES; Index: adddev.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/adddev.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** adddev.c 23 Nov 2006 11:10:10 -0000 1.23 --- adddev.c 11 Jan 2007 14:50:28 -0000 1.24 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2004-2006 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2004-2007 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,29 ---- * * $Log$ + * Revision 1.24 2007/01/11 14:50:28 vfrolov + * Pool functions replaced by + * C0C_ALLOCATE_POOL() + * C0C_ALLOCATE_POOL_WITH_QUOTA() + * C0C_FREE_POOL() + * * Revision 1.23 2006/11/23 11:10:10 vfrolov * Strict usage fixed port numbers *************** *** 562,569 **** busyMaskLen = (numNext + (sizeof(*pBusyMask)*8 - 1))/(sizeof(*pBusyMask)*8); ! pBusyMask = ExAllocatePool(PagedPool, busyMaskLen); if (!pBusyMask) { ! SysLog(pDrvObj, STATUS_INSUFFICIENT_RESOURCES, L"AllocPortNum ExAllocatePool FAIL"); return numNext; } --- 568,575 ---- busyMaskLen = (numNext + (sizeof(*pBusyMask)*8 - 1))/(sizeof(*pBusyMask)*8); ! pBusyMask = C0C_ALLOCATE_POOL(PagedPool, busyMaskLen); if (!pBusyMask) { ! SysLog(pDrvObj, STATUS_INSUFFICIENT_RESOURCES, L"AllocPortNum C0C_ALLOCATE_POOL FAIL"); return numNext; } *************** *** 597,601 **** } ! ExFreePool(pBusyMask); return num; --- 603,607 ---- } ! C0C_FREE_POOL(pBusyMask); return num; *************** *** 625,629 **** len = sizeof(KEY_VALUE_FULL_INFORMATION) + sizeof(ULONG); ! pInfo = ExAllocatePool(PagedPool, len); if (pInfo) { --- 631,635 ---- len = sizeof(KEY_VALUE_FULL_INFORMATION) + sizeof(ULONG); ! pInfo = C0C_ALLOCATE_POOL(PagedPool, len); if (pInfo) { *************** *** 633,637 **** numPref = *(PULONG)pInfo->Data; ! ExFreePool(pInfo); } --- 639,643 ---- numPref = *(PULONG)pInfo->Data; ! C0C_FREE_POOL(pInfo); } Index: pnp.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/pnp.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pnp.c 23 Jun 2006 07:37:24 -0000 1.5 --- pnp.c 11 Jan 2007 14:50:29 -0000 1.6 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2004-2006 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2004-2007 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,29 ---- * * $Log$ + * Revision 1.6 2007/01/11 14:50:29 vfrolov + * Pool functions replaced by + * C0C_ALLOCATE_POOL() + * C0C_ALLOCATE_POOL_WITH_QUOTA() + * C0C_FREE_POOL() + * * Revision 1.5 2006/06/23 07:37:24 vfrolov * Disabled usage pDevExt after deleting device *************** *** 83,87 **** countRelations = pRelationsPrev ? pRelationsPrev->Count : 0; ! pRelations = (PDEVICE_RELATIONS)ExAllocatePool(PagedPool, sizeof(DEVICE_RELATIONS) + ((countPdos + countRelations - 1) * sizeof (PDEVICE_OBJECT))); --- 89,93 ---- countRelations = pRelationsPrev ? pRelationsPrev->Count : 0; ! pRelations = (PDEVICE_RELATIONS)C0C_ALLOCATE_POOL(PagedPool, sizeof(DEVICE_RELATIONS) + ((countPdos + countRelations - 1) * sizeof (PDEVICE_OBJECT))); *************** *** 105,109 **** if (pRelationsPrev) ! ExFreePool(pRelationsPrev); pIrp->IoStatus.Information = (ULONG_PTR)pRelations; --- 111,115 ---- if (pRelationsPrev) ! C0C_FREE_POOL(pRelationsPrev); pIrp->IoStatus.Information = (ULONG_PTR)pRelations; *************** *** 226,230 **** PPNP_BUS_INFORMATION pBusInfo; ! pBusInfo = (PPNP_BUS_INFORMATION)ExAllocatePool(PagedPool, sizeof(PNP_BUS_INFORMATION)); if (!pBusInfo) --- 232,236 ---- PPNP_BUS_INFORMATION pBusInfo; ! pBusInfo = (PPNP_BUS_INFORMATION)C0C_ALLOCATE_POOL(PagedPool, sizeof(PNP_BUS_INFORMATION)); if (!pBusInfo) Index: delay.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/delay.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** delay.c 23 Jun 2006 11:44:52 -0000 1.4 --- delay.c 11 Jan 2007 14:50:29 -0000 1.5 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2005-2006 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2005-2007 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,29 ---- * * $Log$ + * Revision 1.5 2007/01/11 14:50:29 vfrolov + * Pool functions replaced by + * C0C_ALLOCATE_POOL() + * C0C_ALLOCATE_POOL_WITH_QUOTA() + * C0C_FREE_POOL() + * * Revision 1.4 2006/06/23 11:44:52 vfrolov * Mass replacement pDevExt by pIoPort *************** *** 112,116 **** PC0C_ADAPTIVE_DELAY pWriteDelay; ! pWriteDelay = (PC0C_ADAPTIVE_DELAY)ExAllocatePool(NonPagedPool, sizeof(*pWriteDelay)); if (!pWriteDelay) --- 118,122 ---- PC0C_ADAPTIVE_DELAY pWriteDelay; ! pWriteDelay = (PC0C_ADAPTIVE_DELAY)C0C_ALLOCATE_POOL(NonPagedPool, sizeof(*pWriteDelay)); if (!pWriteDelay) *************** *** 136,140 **** pIoPort->pWriteDelay = NULL; StopWriteDelayTimer(pWriteDelay); ! ExFreePool(pWriteDelay); } } --- 142,146 ---- pIoPort->pWriteDelay = NULL; StopWriteDelayTimer(pWriteDelay); ! C0C_FREE_POOL(pWriteDelay); } } |