;============================================================================================================================================= ; step_8.asm ;This program will show you how to receive the current net name ; Algorithm ;A1: Get the name ;(C)I don't take any responsibility for the use of this program ; Zedr0n -- connection closed ;============================================================================================================================================= ;============================================================================================================================================= ; Options/Declarations ;============================================================================================================================================= .386 .model flat, stdcall option casemap:none include windows.inc include kernel32.inc include mpr.inc include user32.inc includelib \masm32\lib\kernel32.lib includelib \masm32\lib\mpr.lib includelib \masm32\lib\user32.lib ;============================================================================================================================================= ; Data segment ;============================================================================================================================================= .data sizeA db 255 Caption db "Zedr0n's WinApi step #8",0 ;============================================================================================================================================ ; Variables segment ;============================================================================================================================================ .data? NameA db 255 dup(?) ;============================================================================================================================================= ; Code segment ;============================================================================================================================================= .code start: A1: invoke WNetGetUser,NULL,offset NameA,offset sizeA .if eax==NO_ERROR invoke MessageBox,NULL,offset NameA,offset Caption,MB_OK .endif invoke ExitProcess,NULL end start