0X110.cpp
上传用户:hyz2004817
上传日期:2022-03-30
资源大小:226k
文件大小:1k
- #include "stdafx.h"
- extern CHAR g_pszOS[6];
- extern BOOL g_bMustExit;
- BOOL
- WINAPI
- RCAID_0X110_HANDLER(
- SOCKET s,
- RCAREQUESTHANDLEDATA * pData,
- RCAREQUESTHEADER * pRCAHead,
- HANDLE hEventArray[2]
- )
- {
- RCACOMPUTERINFO ci;
-
- lstrcpy( ci.pszOS , g_pszOS );
-
- GlobalMemoryStatus( &(ci.memoryStatus) );
- HDC hdc = CreateDC( "DISPLAY", NULL, NULL, NULL );
- if( hdc == NULL )
- return FALSE;
- ci.dwScreenWidth = GetDeviceCaps( hdc, HORZRES );
- ci.dwScreenHeight = GetDeviceCaps( hdc, VERTSIZE );
- ci.dwScreenBitCount = GetDeviceCaps( hdc, BITSPIXEL );
- DeleteDC( hdc );
- RCARESPONSEHEADER rresh;
-
- InitResponseHead( & rresh, RCA_RESPONSE_200_OK, sizeof(rresh) + sizeof(ci));
-
- int ret;
- BOOL bExit = FALSE;
- ret = RCASend_EventSelectIO( s, hEventArray, (char*)&rresh, sizeof(rresh));
- if( ret != sizeof(rresh) )
- return FALSE;
- ret = RCASend_EventSelectIO( s, hEventArray, (char*)&ci, sizeof(rresh));
- if( ret != sizeof(rresh) )
- return FALSE;
- return TRUE;
- }