Join a computer to Domain?

I am looking for a function call that allows my local computer
to go from a workgroup member to joining a specific domain. I know how
to do it through the Network control panel; how can it be done
programmatically? I have been searching the NET APIs, and found
but this function just supported by Win2K, My program must run on
Does anybody have some suggestion?