Modified Windows copy function