Stopping medications before knee or hip surgery

Which drugs need to be stopped before surgery and how far in advance?