Preface Acknowledgments PartⅠ Server Basics Chapter1 Server-Based Development WHAT IS A SERVER? THE GROWTH OF SERVER-BASED DEVELOPMENT NetWare Cracks in the Fat Client Model The Internet:A Solution to TCO Problems The Intranet:Bandwidth Nirvana Windows 2000 Hardware Support WHAT MAKES SERVER-BASED DEVELOPMENT DIFFERENT? The Server Is Unattended Resource Leaks Are Hidden Bugs Multitasking Is Essential SERVER-BASED APPLICATIONS Traditional Server-Based Systems The Web-Based Server WIN32 SUPPORT FOR SERVER-BASED PROGRAMMING The Console API The Service API The Impersonation API The Event Logging API RAS,MAPI,and TAPI Database Connectivity Active Server Pages The Internet Server API Communication APIs A PEEK AT SQL SERVER CONCLUSION Chapter2 Server-Based Development 101 MULTITASKING BASICS Cooperative Multitasking Preemptive Multitasking MULTITHREADING SYNCHRONIZATION OBJECTS Critical Sections Events Mutexes Semaphores Waitable Timers Wait Functions and Thread Synchronization CREATING A NEW THREAD Thread Creation Functions A Multithreaded Example Program PartⅡ Windows 2000 as a Server Platform Chapter3 The Service API WHAT IS THE SERVICE API? WHO RUNS THE SERVICE? HELLO,SERVICE API WORLD! Installing the Service Using CreateService to Install the Service Using DeleteService to Uninstall the Service Starting the Service Inside ServiceMain A C++FRAMEWORK FOR WINDOWS 2000 SERVICES Writing a C++ Class for Windows 2000 Services Is Harder Than It Looks Implementing the C++ Service Class One More Enhancement CONCLUSION Chapter4 Impersonation APIs WINDOWS 2000 SECURITY OVERVIEW IMPERSONATION BASICS CLASSES OF IMPERSONATION Impersonation Based on a Connection Impersonation Based on Information About the Client Protecting Server-Specific Resources Putting Impersonation and Custom Security Together CONCLUSION Chapter5 Event Logging THE EVENT LOGGING API Writing Events to the Event Log Adding Event Logging to CPPService Reading Events from the Event Log CONCLUSION Chapter6 Remote Access Service API RAS API OVERVIEW AN EXAMPLE USING RASDIAL Controlling Multiple Threads The RasDialFunc2 Callback Function OTHER USES FOR RAS CONCLUSION Chapter7 Telephony API and the Messaging API TAPI TAPI Versions TAPI Devices TAPI Errors Getting Feedback from TAPI A TAPI Example What Else Can TAPI Do? MAPI Flavors of MAPI Selecting the Correct Client Interface Simple MAPI? Full MAPI? Putting It All Together:Using MAPI and TAPI in a Service CONCLUSION Chapter8 The ODBC API WHAT ODBC PROVIDES ODBC ALTERNATIVES ODBC COMPONENTS The Application The Driver Manager The Drivers The Data Sources ODBC Classes An Example:ODBC Classes in Action The ODBCDatabase Class The ODBCCursor Class Chapter9 Active Server Pages WHAT IS AN ACTIVE SERVER PAGE? It’s like an HTML Page... ...But It’s Not Exactly the Same as an HTML Page ASP STRENGTHS ASP WEAKNESSES OBJECTS AVAILABLE IN ASP APPLICATIONS The Application Object The Session Object The Server Object The Request Object The Response Object The ObjectContext Object ACTIVE SERVER PAGE EXAMPLES A Simple Phone Directory A More Complex ASP Example:Troubleshooter CONCLUSION Chapter10 Internet Server API(ISAPI) DLL REVIEW ISAPI OVERVIEW Benefits of ISAPI over CGI Benefits of ISAPI over ASP A SIMPLE ISAPI EXTENSION MFC—A Better Way to Create an ISAPI Extension ANOTHER USE FOR AN ISAPI EXTENSION CONCLUSION Chapter11 ISAPI Filters ISAPI FILTER OVERVIEW Functions Exported by ISAPI Filter DLLs A SAMPLE ISAPI FILTER MFC ISAPI FILTERS CONCLUSION Chapter12 Client/Server Communication APIs CAN TE TALK?HOW CLIENTS AND SERVERS COMMUNICATE TCP/IP (WinSock) Named Pipes WinSock or Named Pipes? DISPATCHING COMMUNICATION REQUESTS Managing Client State Managing Failures Dispatching Requests WinSock vs.Named Pipes Events vs.I/O Completion Ports vs.QueueUserWorkItem A GENERALIZED CLIENT COMMUNICATION CLASS CONCLUSION Chapter13 Integrating with SQL Server TRANSACT-SQL Triggers Stored Procedures Extended Stored Procedures CONCLUSION PartⅢ Building Windows 2000 Server Applications Chapter14 A Traditional Service Application A NETWORK MONITOR What Is a Network Monitor? The Network Monitor’s Structure The CMonitorService Class MONITORING TASK FUNCTIONS CONCLUSION Chapter15 Administering a Service Application on the Web USING ASP TO MONITOR MONITORSERVICE Interacting with Alerts Interacting with Tasks USING ISAPI TO MONITOR MONITORSERVICE CMonitorService Modifications The ISAPIMonitor ISAPI Extension CONCLUSION AppendixA Setting Up Virtual Directories in IIS CONCLUSIONS AppendixB Reacting to Service Failures Bibliography Index