Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DWORD GetServerHandle( void ) {
- HANDLE hFileMapping;
- PDWORD pServerID;
- DWORD Result = 0;
- hFileMapping = CreateFileMapping( INVALID_HANDLE_VALUE, NULL, PAGE_READONLY, 0, sizeof(HANDLE), L"smartipc" );
- if( hFileMapping ) {
- pServerID = ( DWORD *)MapViewOfFile( hFileMapping, FILE_MAP_READ, 0,0,0 );
- if( pServerID ) {
- Result = *pServerID;
- UnmapViewOfFile( pServerID );
- }
- } else Result = 0;
- return Result;
- }
- int _tmain(int argc, _TCHAR* argv[]) {
- GetServerHandle();
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment