Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
buffer.cpp
Package: shell.rar [view]
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 1k
Category:
Windows Kernel
Development Platform:
Visual C++
- /*****************************************************************/
- /** Microsoft Windows for Workgroups **/
- /** Copyright (C) Microsoft Corp., 1991-1992 **/
- /*****************************************************************/
- /* BUFFER.CPP -- Implementation of BUFFER class.
- *
- * History:
- * 03/24/93 gregj Created
- * 10/25/93 gregj Use shell232.dll routines
- */
- #include "npcommon.h"
- #include "buffer.h"
- #include <netlib.h>
- BOOL BUFFER::Alloc( UINT cbBuffer )
- {
- _lpBuffer = (LPSTR)::MemAlloc(cbBuffer);
- if (_lpBuffer != NULL) {
- _cb = cbBuffer;
- return TRUE;
- }
- return FALSE;
- }
- BOOL BUFFER::Realloc( UINT cbNew )
- {
- LPVOID lpNew = ::MemReAlloc(_lpBuffer, cbNew);
- if (lpNew == NULL)
- return FALSE;
- _lpBuffer = (LPSTR)lpNew;
- _cb = cbNew;
- return TRUE;
- }
- BUFFER::BUFFER( UINT cbInitial /* =0 */ )
- : BUFFER_BASE(),
- _lpBuffer( NULL )
- {
- if (cbInitial)
- Alloc( cbInitial );
- }
- BUFFER::~BUFFER()
- {
- if (_lpBuffer != NULL) {
- ::MemFree(_lpBuffer);
- _lpBuffer = NULL;
- }
- }