현재 델파이로 마크주소 얻는 프로그램을 짯는데요.ㅠㅠ
그런데 마크주소가 실지 물리적인 마크주소가 아니고 다른값이 나오네요.
실지적인 마크주소를 얻는 방법좀 가르켜 주세요. ㅠㅠ
소스는 다음과 같습니다. 고수님들 좀 도와주세요.
-------------------------------------------
function GetMACAdress: string;
var
hDll : THandle;
FPointer : TFarProc;
MyFunc : TIntFunction;
var_uu : TGUID;
szMacAddr : String;
i : Integer;
begin
Result :='';
szMacAddr := '';
hDll := SafeLoadLibrary ('RPCRT4.DLL');
if hDll <> 0 then
FPointer := GetProcAddress(hDll,'UuidCreateSequential')
else
begin
ShowMessage('DLL not found');
exit;
end;
if FPointer = nil then
begin
FreeLibrary (hDll);
ShowMessage ('DLL function not found');
exit;
end;
MyFunc := TIntFunction (FPointer);
MyFunc(@var_uu);
FreeLibrary (hDll);
for i := 2 to 7 do
szMacAddr := szMacAddr + IntToHex(var_uu.D4[i], 2);
Result := szMacAddr;
// OutDebugString(Result);
end;
|