一个关于函数别名的问题
caike 2005-02-16 11:37:17 function _CreateMutex(lpMutexAttributes: PSecurityAttributes;
bInitialOwner: Integer; lpName: PChar): THandle; stdcall; external kernel32 name 'CreateMutexA';
function CreateMutex(lpMutexAttributes: PSecurityAttributes; bInitialOwner: BOOL; lpName: PChar): THandle;
begin
Result := _CreateMutex(lpMutexAttributes, Integer(Boolean(bInitialOwner)), lpName);
end;
function _CreateMutexA(lpMutexAttributes: PSecurityAttributes;
bInitialOwner: Integer; lpName: PAnsiChar): THandle; stdcall; external kernel32 name 'CreateMutexA';
function CreateMutexA(lpMutexAttributes: PSecurityAttributes; bInitialOwner: BOOL; lpName: PAnsiChar): THandle;
begin
Result := _CreateMutexA(lpMutexAttributes, Integer(Boolean(bInitialOwner)), lpName);
end;
================================
像上面这种情况,如果我调用CreateMutexA函数,是执行哪个呢?_CreateMutex和_CreateMutexA都是取别名CreateMutexA。
还想问一下,在单元中可以重新定义所引用的API函数吗?如上面两个程序段,就是重新定义了所引用的API函数?