dup.c:	if((DuplicateHandle(GetCurrentProcess(), f->hand,
dup.c:	if((fd = _allocfile(fg, newhand, f->type, f->omode, f->path, dst)) == -1){
fd2path.c:	strecpy(s, s + n, f->path);
fd2path.c:	if(strlen(f->path) >= n)
file.c:	f->hand = hand;
file.c:	f->type = type;
file.c:	f->omode = omode;
file.c:	f->path = path;
file.c:	f->off = 0;
file.c:	f->slot = 0;
file.c:	free(f->path);
file.c:	if(f->type == Tdir)
file.c:		FindClose(f->hand);
file.c:		CloseHandle(f->hand);
file.old.c:		if(f->h != nil){
file.old.c:			if(f->h == nil)
file.old.c:	f->h = h;
file.old.c:	f->type = type;
file.old.c:	f->omode = omode;
file.old.c:	f->path = _reslash(path);
file.old.c:	if(f->path == nil)
file.old.c:	f->off = 0;
file.old.c:	f->slot = 0;
file.old.c:	free(f->path);
file.old.c:	CloseHandle(f->h);
file.old.c:	f->h = nil;
fstat.c:	switch(f->type){
fstat.c:		if(_dostat(f->path, &d) == -1){
fstat.c:		if(GetFileInformationByHandle(f->hand, &hfi) == 0){
fstat.c:		_info2dir(f->path, nil, &hfi, &d);
fstat.c:		if(GetFileInformationByHandle(f->hand, &hfi) == 0){
fstat.c:		_info2dir(f->path, nil, &hfi, &d);
fstat.c:		if(PeekNamedPipe(f->hand, NULL, 0, NULL, &avail, NULL) == 0){
fwstat.c:	rc = _dowstat(f->path, &d);
fwstat.c:	FlushFileBuffers(f->hand);		// ignore errors - best effort only
pread.c:	if(f->omode == OWRITE){
pread.c:		off = f->off;
pread.c:	switch(f->type){
pread.c:		if(ReadFile(f->hand, s, n, &got, &ol) == 0)
pread.c:					CancelIo(f->hand);
pread.c:				if(GetOverlappedResult(f->hand, &ol, &got, 0) == 0){
pread.c:				CancelIo(f->hand);
pread.c:	f->off = off + got;
proc.c:		p->vfork = vf->next;
proc.c:	vf->pid = -1;
proc.c:	vf->ppid = p->pid;
proc.c:	vf->flags = flags;
proc.c:	vf->next = p->vfork;
pwrite.c:	if(f->omode == OREAD){
pwrite.c:		off = f->off;
pwrite.c:	switch(f->type){
pwrite.c:		if(WriteFile(f->hand, s, n, &got, &ol) == 0){
pwrite.c:				CancelIo(f->hand);
pwrite.c:					CancelIo(f->hand);
pwrite.c:				if(GetOverlappedResult(f->hand, &ol, &got, 0) == 0){
pwrite.c:				CancelIo(f->hand);
pwrite.c:	f->off = off + got;
readdir.c:		werrstr("'%s' %s", f->path, _winerr());
readdir.c:	if(f->slot == 0){
readdir.c:		if(f->hand != BadHand)
readdir.c:			FindClose(f->hand);
readdir.c:		tmp = _winpath2(f->path, L"*");
readdir.c:		if((f->hand = FindFirstFile(tmp, &fd)) == BadHand){
readdir.c:			if(FindNextFile(f->hand, &fd) == 0){
readdir.c:			if(FindNextFile(f->hand, &fd) == 0){
readdir.c:	_find2dir(f->path, nil, &fd, &d);
readdir.c:	f->slot++;
refcnt.c:	r->ref--;
seek.c:	switch(f->type){
seek.c:		f->off = off;
seek.c:		f->off += off;
seek.c:		if((lo = GetFileSize(f->hand, &hi)) == INVALID_FILE_SIZE){
seek.c:			werrstr("'%s' cannot get file size", f->path);
seek.c:		f->off = (((vlong)hi >> 32 ) | lo) + off;
seek.c:	return f->off;
spawn.c:	if(!DuplicateHandle(GetCurrentProcess(), f->hand,
