getdiskfreespaceex returned an error Yates Center Kansas

Address 121 E Main St, Chanute, KS 66720
Phone (620) 431-0320
Website Link

getdiskfreespaceex returned an error Yates Center, Kansas

This parameter does not have to specify the root directory on a disk. Anyone Understand how the chain rule was applied here? Make a suggestion Dev centers Windows Office Visual Studio Microsoft Azure More... Here we are using NULL, using the root of the current disk LPCWSTR pszDrive = NULL; BOOL test, fResult; // 64 bits integer, low and high bytes __int64 lpFreeBytesAvailable, lpTotalNumberOfBytes,

szDrive[0] = 'C'; // <-- specifying drive szDrive[1] = ':'; szDrive[2] = '\\'; szDrive[3] = '\0'; pszDrive = szDrive; ... The GetDiskFreeSpaceEx works successfully on a WinMobile platform, but does not appear to be successful on this base CE 5.0 platform and returns a last error of 1222: The network is GetDiskSpace = TotalBytes * 10000 End If 'if GetDiskFreeSpaceEx Else 'get drive info using GetDiskFreeSpace If GetDiskFreeSpace(sDrive, nSectors, _ nBytesPerSector, _ nFreeClusters, _ nTotalClusters) <> 0 Then 'perform math to get This is fairly typical for what happens when you create directories with such long names.

without the GetProcAddress stuff - still didn't work... –Jace Feb 15 '13 at 2:06 1 Note also that passing NULL will retrieve the free disk space for the current directory. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.Would you like to participate? Has someone faced similar problems. Do not truncate these values to 32 bits.

What's behind the word "size issues"? Generated Mon, 17 Oct 2016 03:46:06 GMT by s_wx1094 (squid/3.5.20) You can bypass the Win32 restriction by using the path name using the native api format. Please try the request again.

This code should also provide the correct results on a non-Fat32 drive as well, though is untested here. Mattias -- Mattias Sjgren [MVP] mattias @ | Please reply only to the newsgroup. If the function fails, the return value is 0 (zero). There are from a Linux box running Samba.

What does the GetCurrentDirectory function report that directory to be? Somewhat understandable, it isn't normally asked to deal with long names. To get extended error information, call GetLastError. I felt a little dirty passing an unescaped path from the host but it worked.

Privacy statement Help us improve MSDN. C and C++ Programming Resources | C & C++ Code Example Index Confidentialité- FranceNotre réseau a détecté que vous êtes localisé en France.SlashdotMedia accorde de l’importance à la vie privée de I'm not using GetProcAddress because I wouldn't expect anyone these days to run Windows 95. –JosephH Feb 15 '13 at 2:02 strange... On Local Error Resume Next GetDiskBytesAvailable = (nSectors * nBytesPerSector * nFreeClusters) On Local Error GoTo 0 End If 'if GetDiskFreeSpace End If 'If ptr End Function Comments Run the project,

Robert Reeves Reply via email to Search the site The Mail Archive home nagios-users - all messages nagios-users - about the list Expand Previous message Next message The Mail Archive home Nobody cared much for the POSIX and OS/2 layers, they were dropped at XP time. GetDiskSpaceFree = TotalBytesFree * 10000 End If 'if GetDiskFreeSpaceEx Else 'get drive info using GetDiskFreeSpace If GetDiskFreeSpace(sDrive, _ nSectors, _ nBytesPerSector, _ nFreeClusters, _ nTotalClusters) <> 0 Then 'perform math to Does anybody have a solution for this?

No coincidence, David Cutler used to work for DEC. Server file space monitoring P/Invoke ? Yes No Additional feedback? 1500 characters remaining Submit Skip this Thank you! The wrappers are also ideal when only one particular piece of info is needed (i.e.

Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Answered by: Windows CE 5.0 GetDiskFreeSpaceEx failing, returning GetLastError 1222 Smart Device Development Note that in doing this that 1) partitions over 2 gig on the original Windows 95 will return incorrect values, and 2) that on NTFS systems, each GetDiskFreeSpace call will overflow I'm using this sample code: And it works! Symbolic link behavior—If the path points to a symbolic link, the operation is performed on the target.

If this parameter is NULL, the function uses the root of the current disk. Not the answer you're looking for? The Windows kernel has a completely different api, it resembles the DEC VMS operating system a lot. Extrapolating further, GetDiskFreeSpaceEx() failed because it has a bug, it rejects the long name it sees when you pass NULL.

fResult = pGetDiskFreeSpaceEx ((LPCTSTR)pszDrive,     (PULARGE_INTEGER)&i64FreeBytesToCaller,     (PULARGE_INTEGER)&i64TotalBytes, (PULARGE_INTEGER)&i64FreeBytes); fResult becomes true and i can go on to accurately calculate the number of free bytes available. free space). I simply need to make sure the drives are accessible from the Windows server, so I'm willing to go in a different location instead of checking free space left. I have both NRPE_NT and nsclient running on the Windows boxes.

I neglected to check this thread after a couple days but figured out my problem anyway. Is it a valid directory? What happens when you pass the result of GetCurrentDirectory to GetDiskFreeSpaceEx? –Cody Gray Feb 15 '13 at 5:58 | show 4 more comments 2 Answers 2 active oldest votes up vote StripNulls 'will continually shorten the 'string.

Post your question and get tips & solutions from a community of 418,553 IT Pros & Developers. Loop until a single 'remaining terminating null is 'encountered. The function accepts any directory on a disk. Why would a password requirement prohibit a number in the last character?

fResult = GetDiskFreeSpace(pszDrive, &dwSectPerClust, &dwBytesPerSect, &dwFreeClusters, &dwTotalClusters); printf("\nUsing GetDiskFreeSpace()...\n"); printf("The return value: %d, error code: %d\n", fResult, GetLastError()); printf("Sector per cluster = %ul\n", dwSectPerClust); printf("Bytes per sector = %ul\n", dwBytesPerSect); I also switched out my pGetDiskFreeSpaceEx pointer out for the actual GetDiskFreeSpaceEx() function call too - ie.