Remove the useless wrapper MemCopy(). Resolve the bug of closing directory.