⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 roshttpd.cpp

📁 ReactOS是一些高手根据Windows XP的内核编写出的类XP。内核实现机理和API函数调用几乎相同。甚至可以兼容XP的程序。喜欢研究系统内核的人可以看一看。
💻 CPP
字号:
/*
 * COPYRIGHT:   See COPYING in the top level directory
 * PROJECT:     ReactOS HTTP Daemon
 * FILE:        roshttpd.cpp
 * PURPOSE:     Main program
 * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
 * REVISIONS:
 *   CSH  01/09/2000 Created
 */
#include <debug.h>
#include <new>
#include <winsock2.h>
#include <stdio.h>
#include <config.h>
#include <error.h>
#include <httpd.h>

using namespace std;


VOID Run()
{
    InitWinsock();

    pDaemonThread = NULL;
	pConfiguration = NULL;

	try {
        // Create configuration object
		pConfiguration = new CConfig;
        pConfiguration->Default();

        // Create daemon object
        pDaemonThread = new CHttpDaemonThread;

		MSG Msg;
		BOOL bQuit = FALSE;
		while ((!bQuit) && (!pDaemonThread->Terminated())) {
		    bQuit = PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE);
			if (!bQuit)
			    DispatchMessage(&Msg);
        }

		delete pDaemonThread;

		if (pConfiguration != NULL)
		    delete pConfiguration;
	} catch (bad_alloc e) {
		if (pConfiguration != NULL)
			delete pConfiguration;
		ReportErrorStr(TS("Insufficient resources."));
	}

    DeinitWinsock();
}

/* Program entry point */
int main(int argc, char* argv[])
{
    printf("ReactOS HTTP Daemon\n");
    printf("Type Control-C to stop.\n");

    Run();

    printf("Daemon stopped.\n");
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -