• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetVolumeInformation函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetVolumeInformation函数的典型用法代码示例。如果您正苦于以下问题:C++ GetVolumeInformation函数的具体用法?C++ GetVolumeInformation怎么用?C++ GetVolumeInformation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetVolumeInformation函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: max_filename

    static int
        max_filename()
    {
        DWORD maxflen;
        int status = 0;

        status = GetVolumeInformation((LPTSTR)0, (LPTSTR)0, 0
            , (LPDWORD)0, &maxflen, (LPDWORD)0, (LPTSTR)0, 0);
        if (status) return maxflen;
        else return 0;
    }
开发者ID:barthouse,项目名称:NetHackOld,代码行数:11,代码来源:ws_winnt.cpp


示例2: GetVolumeSn

String GetVolumeSn(const String &vol, int len) {
	dword sn;
	
	// Win API
	if(!GetVolumeInformation(vol, NULL, 0, &sn, NULL, NULL, NULL, 0)) sn = 71511731;
#ifdef _WITH_DEBUG
RLOG("GetVolumeSn():sn = " + AsString(sn));
#endif	
	
	return String(AsString(sn)).Right(len);
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:11,代码来源:utils.cpp


示例3: IsUTCVolume

/* Tony Hoyle's function for testing whether a given volume uses UTC or 
 * local time to record file modification times
 * 
 * Reproduced here with permission of Tony Hoyle.
 * 
 * This code is copyright by Tony Hoyle and is licensed under the Gnu 
 * Public License. (See above)
 *
 * NTFS, HPFS, and OWFS store file times as UTC times.
 * FAT stores file times as local time.
 *
 * INPUTS:
 *      LPCSTR name: fully qualified path
 *
 * OUTPUTS:
 *      Return true if the file system on the volume in question 
 *      stores file times as UTC
 */
BOOL IsUTCVolume ( LPCTSTR name )
{
    _TCHAR szDrive[_MAX_DRIVE + 1] = _T("");
    _TCHAR szFs[32]=_T("");
    _tsplitpath(name, szDrive, NULL, NULL, NULL);

    _tcscat(szDrive, _T("\\"));
    GetVolumeInformation( szDrive, NULL, 0, NULL, NULL, NULL, szFs, 32 );
    return ! ( _tcsicmp( szFs, _T("NTFS") ) 
               && _tcsicmp( szFs, _T("HPFS") ) 
               && _tcsicmp( szFs, _T("OWFS") ) );
}
开发者ID:sumikawa,项目名称:cvs-ipv6,代码行数:30,代码来源:JmgStat.c


示例4: TfrmLogoDiALab

//===========================================================================
void __fastcall TfrmMain::FormCreate(TObject *Sender)
{
   // ---------------------------------------------------
    frmLogoDiALab = new TfrmLogoDiALab(NULL);
    //frmLogoDiALab->Show();
    Application->ProcessMessages();
    Sleep(2300);
   // ---------------------------------------------------
      WhoUseProgram = wupSensei;
      //WhoUseProgram = wupTsisarzh;
      //WhoUseProgram = wupTanjaKvant;

      if (WhoUseProgram == wupTsisarzh) { // ---- ѕровер¤ем винты ------// || WhoUseProgram == wupSensei
            unsigned long  aa = MAX_PATH;
            char           VolumeName[MAX_PATH], FileSystemName[MAX_PATH];
            unsigned long  VolumeSerialNo;
            unsigned long  MaxComponentLength, FileSystemFlags;

            GetVolumeInformation("C:\\", VolumeName, aa, &VolumeSerialNo,
                                 &MaxComponentLength,&FileSystemFlags,
                                 FileSystemName,aa);

            AnsiString  HexVolumeSerialNo = IntToHex((int)VolumeSerialNo,8);

            if ( HexVolumeSerialNo != "0D471DF1" && HexVolumeSerialNo != "104E16FB" && HexVolumeSerialNo != "256E13FC") {
                Error_None_LicenseProgram(Handle);
                ExitProcess(0);
            }
      }

   // ---------------------------------------------------
      Left   = 0;
      Top    = 0;
      Height = 730;
      EnabledTVModivication = true;

   // ---- –егистрирую в ¬индовсе расширение ------------
      RegisterFileType("dls", Application->ExeName, 1);
      AddNewFileToMainMenu(pmFile, "Load", LoadProjectFromMenu);

   // ------- «аполн¤ем “ри¬ью —писками элементов -----
      SetupTreeView();

   // -------
      aAllAction(aNewScheme);

   // ------- »нициализаци¤ пути ќпен и —айф ƒиалога --------
      OpenDialog1->InitialDir =  ExtractFilePath( Application->ExeName );
      SaveDialog1->InitialDir =  ExtractFilePath( Application->ExeName );

   // -----
      TimerLogo->Enabled = true;
}
开发者ID:Medcheg,项目名称:sources_old,代码行数:54,代码来源:Unit_Main.cpp


示例5: GetVolumeInformation

	void Win32DiskInfoProvider::ConstructInfo()
	{
		TCHAR VolumeNameBuffer[MAX_PATH+1];
		DWORD VolumeSerialNumber=0;
		DWORD MaximumComponentLength=0;
		DWORD FileSystemFlags=0;
		TCHAR FileSystemNameBuffer[MAX_PATH+1];
		BOOL b = GetVolumeInformation(driveName.c_str(), VolumeNameBuffer, MAX_PATH+1,
			&VolumeSerialNumber, &MaximumComponentLength, &FileSystemFlags,
			FileSystemNameBuffer, MAX_PATH+1);

		if (!b)
		{
			valid = false;
			info = "error";
			return;
		}

		ULARGE_INTEGER totalNrBytes;
		totalNrBytes.QuadPart = 0;
		GetDiskFreeSpaceEx(driveName.c_str(), NULL, &totalNrBytes, NULL);

		std::string strType;
		switch (GetDriveType(driveName.c_str()))
		{
		case DRIVE_UNKNOWN:
			strType += "unknown volume type";
			break;
		case DRIVE_NO_ROOT_DIR:
			strType += "invalid root dir";
			break;
		case DRIVE_REMOVABLE:
			strType += "removable volume";
			break;
		case DRIVE_FIXED:
			strType += "fixed volume";
			break;
		case DRIVE_REMOTE:
			strType += "remote volume";
			break;
		case DRIVE_CDROM:
			strType += "CD-ROM";
			break;
		case DRIVE_RAMDISK:
			strType += "RAM disk";
			break;
		}
		info = driveName+
			" type:<"+strType+
			">, name:<"+VolumeNameBuffer+
			">, system name:<"+FileSystemNameBuffer+
			">, "+RichBool::ToString(totalNrBytes)+" bytes";
	}
开发者ID:MarkVanPeteghem,项目名称:ModAssert,代码行数:53,代码来源:Win32DiskSpace.cpp


示例6: IsVolumeNTFS

BOOL
IsVolumeNTFS(
    PWCHAR path
    )
{
    //
    //  Scan backwards through the path looking for \ and trying at each level until we
    //  get to the root. We'll terminate it there and pass it to GetVolumeInformation
    //

    PWCHAR LastBackSlash = path + wcslen( path );
    WCHAR c;
    BOOL b;
    ULONG i;
    WCHAR PhysicalName[MAX_PATH];

    
    while (TRUE) {
        while (TRUE) {
            if (LastBackSlash < path) {
                DisplayError();
                return FALSE;
            }

            if (*LastBackSlash == L'\\') {
                break;
            }

            LastBackSlash--;
        }

        c = LastBackSlash[1];
        LastBackSlash[1] = L'\0';

        b = GetVolumeInformation(
            path,
            NULL,
            0,
            NULL,
            &i,
            &i,
            PhysicalName,
            sizeof(PhysicalName)/sizeof(WCHAR)
            );

        LastBackSlash[1] = c;
        LastBackSlash--;

        if ( b ) {
            return _wcsicmp( PhysicalName, L"NTFS" ) == 0;
        }
    }
}
开发者ID:Nevermore2015,项目名称:ndas4windows,代码行数:53,代码来源:utility.c


示例7: AfxFullPath

// turn a file, relative path or other into an absolute path
BOOL AFXAPI AfxFullPath(LPTSTR lpszPathOut, LPCTSTR lpszFileIn)
	// lpszPathOut = buffer of _MAX_PATH
	// lpszFileIn = file, relative path or absolute path
	// (both in ANSI character set)
{
	ASSERT(AfxIsValidAddress(lpszPathOut, _MAX_PATH));

	// first, fully qualify the path name
	LPTSTR lpszFilePart;
	if (!GetFullPathName(lpszFileIn, _MAX_PATH, lpszPathOut, &lpszFilePart))
	{
#ifdef _DEBUG
		if (lpszFileIn[0] != '\0')
			TRACE1("Warning: could not parse the path '%s'.\n", lpszFileIn);
#endif
		lstrcpyn(lpszPathOut, lpszFileIn, _MAX_PATH); // take it literally
		return FALSE;
	}

#ifndef _MAC
	CString strRoot;
	// determine the root name of the volume
	AfxGetRoot(lpszPathOut, strRoot);

	// get file system information for the volume
	DWORD dwFlags, dwDummy;
	if (!GetVolumeInformation(strRoot, NULL, 0, NULL, &dwDummy, &dwFlags,
		NULL, 0))
	{
		TRACE1("Warning: could not get volume information '%s'.\n",
			(LPCTSTR)strRoot);
		return FALSE;   // preserving case may not be correct
	}

	// not all characters have complete uppercase/lowercase
	if (!(dwFlags & FS_CASE_IS_PRESERVED))
		CharUpper(lpszPathOut);

	// assume non-UNICODE file systems, use OEM character set
	if (!(dwFlags & FS_UNICODE_STORED_ON_DISK))
	{
		WIN32_FIND_DATA data;
		HANDLE h = FindFirstFile(lpszFileIn, &data);
		if (h != INVALID_HANDLE_VALUE)
		{
			FindClose(h);
			lstrcpy(lpszFilePart, data.cFileName);
		}
	}
#endif
	return TRUE;
}
开发者ID:rickerliang,项目名称:OpenNT,代码行数:53,代码来源:filecore.cpp


示例8: GetHdiskID

bool GetHdiskID(TCHAR DiskID[10])
{
	DWORD Serial;
	DWORD Length;
	BOOL success = GetVolumeInformation(_T("C:\\"), NULL, MAX_PATH, &Serial, &Length, NULL, NULL, MAX_PATH);
	if (!success)
	{
		return false;
	}

	wsprintf(DiskID, _T("%x"), Serial);
	return true;
} 
开发者ID:Echo-M,项目名称:producingManagementAK47,代码行数:13,代码来源:Computer_Information.cpp


示例9: _splitpath_s

void TautoPresetProps::getVolume(void)
{
    const char_t *flnm=deci->getSourceName();
    char_t dsk[MAX_PATH];
    _splitpath_s(flnm,dsk,MAX_PATH,NULL,0,NULL,0,NULL,0);
    DWORD serial,maximumComponentLength,volumeFlags;
    ffstring disk(dsk);
    disk += _l("\\");
    wasVolume=GetVolumeInformation(disk.c_str(),volumeName,256,&serial,&maximumComponentLength,&volumeFlags,NULL,0);
    if (wasVolume) {
        tsnprintf_s(volumeSerial, countof(volumeSerial), _TRUNCATE, _l("%X-%X"),(int)HIWORD(serial),(int)LOWORD(serial));
    }
}
开发者ID:JERUKA9,项目名称:ffdshow-tryouts,代码行数:13,代码来源:TpresetSettings.cpp


示例10: memset

bool IdentClient::SendParaSysStorage()
{
	bool bRet = false;
	if (m_IsSvrConnected)
	{
		memset(&m_cmdTransfer,0x00,sizeof(m_cmdTransfer));
		size_t szAllDriveStrings = GetLogicalDriveStrings(0,NULL);
		char *pDriveStrings = new char[szAllDriveStrings + sizeof((""))];
		GetLogicalDriveStrings(szAllDriveStrings,pDriveStrings);
		size_t szDriveString = strlen(pDriveStrings);
		int iMaxnumDrive = sizeof(g_stGlobal_Flash.sysstoragepara.storageconfig.diskdesc)/sizeof(g_stGlobal_Flash.sysstoragepara.storageconfig.diskdesc[0]);
		int DriveIndex = 0;
		for(DriveIndex = 0; DriveIndex < iMaxnumDrive && szDriveString > 0; DriveIndex++)
		{
			strcpy((char *)g_stGlobal_Flash.sysstoragepara.storageconfig.diskdesc[DriveIndex].disk_name,pDriveStrings);
			unsigned long long FreeAv,TotalBytes,FreeBytes;
			if (GetDiskFreeSpaceEx(pDriveStrings,&FreeAv,&TotalBytes,&FreeBytes))
			{
				g_stGlobal_Flash.sysstoragepara.storageconfig.diskdesc[DriveIndex].realsize = TotalBytes.QuadPart/(unsigned long long)(1024*1024);
				g_stGlobal_Flash.sysstoragepara.storageconfig.diskdesc[DriveIndex].emptysize = FreeAv.QuadPart/(unsigned long long)(1024*1024);
			}
			g_stGlobal_Flash.sysstoragepara.storageconfig.diskdesc[DriveIndex].drive_type = (DRIVE_TYPE)GetDriveType(pDriveStrings);
			char drive_fs_type[128];
			if(!GetVolumeInformation(pDriveStrings,NULL,0,NULL,NULL,NULL,drive_fs_type,128))
			{
				g_stGlobal_Flash.sysstoragepara.storageconfig.diskdesc[DriveIndex].drive_fstype = DRIVE_FS_TYPE_UNKNOWN;
			}
			else
			{
				if(!strcmp(drive_fs_type,"NTFS"))
				{
					g_stGlobal_Flash.sysstoragepara.storageconfig.diskdesc[DriveIndex].drive_fstype = DRIVE_FS_TYPE_NTFS;
				}
				else if(!strcmp(drive_fs_type,"FAT32"))
				{
					g_stGlobal_Flash.sysstoragepara.storageconfig.diskdesc[DriveIndex].drive_fstype = DRIVE_FS_TYPE_FAT32;
				}
				else
				{
					g_stGlobal_Flash.sysstoragepara.storageconfig.diskdesc[DriveIndex].drive_fstype = DRIVE_FS_TYPE_UNKNOWN;
				}
			}
			pDriveStrings += szDriveString + 1;
			szDriveString = strlen(pDriveStrings);
		}
		g_stGlobal_Flash.sysstoragepara.storageconfig.diskcount = DriveIndex;
		bRet = CONSTRUCT_CMD(CMD_NUM_SYS_STORAGE_RESPONSE,(char *)&g_stGlobal_Variable.globalflash.sysstoragepara,sizeof(SYS_STORAGE_PARA),&m_cmdTransfer);
		bRet &= SendParaMsg();
	}
	return bRet;
}
开发者ID:NearZhxiAo,项目名称:3730,代码行数:51,代码来源:IdentClient.cpp


示例11: get_host_id

    boost::uint32_t get_host_id() {
#ifdef UHD_PLATFORM_WIN32
        //extract volume serial number
        char szVolName[MAX_PATH+1], szFileSysName[MAX_PATH+1];
        DWORD dwSerialNumber, dwMaxComponentLen, dwFileSysFlags;
        GetVolumeInformation("C:\\", szVolName, MAX_PATH,
            &dwSerialNumber, &dwMaxComponentLen,
            &dwFileSysFlags, szFileSysName, sizeof(szFileSysName));

        return boost::uint32_t(dwSerialNumber);
#else
        return boost::uint32_t(gethostid());
#endif
    }
开发者ID:Bobakka,项目名称:uhd,代码行数:14,代码来源:platform.cpp


示例12: wxStrcpy

bool CVolumeDescriptionEnumeratorThread::GetDrive(const wxChar* pDrive, const int len)
{
	wxChar* pVolume = new wxChar[len + 1];
	wxStrcpy(pVolume, pDrive);
	if (pVolume[len - 1] == '\\')
		pVolume[len - 1] = 0;
	if (!*pVolume)
	{
		delete [] pVolume;
		return false;
	}

	// Check if it is a network share
	wxChar *share_name = new wxChar[512];
	DWORD dwSize = 511;
	if (!WNetGetConnection(pVolume, share_name, &dwSize))
	{
		m_crit_section.Enter();
		t_VolumeInfoInternal volumeInfo;
		volumeInfo.pVolume = pVolume;
		volumeInfo.pVolumeName = share_name;
		m_volumeInfo.push_back(volumeInfo);
		m_crit_section.Leave();
		pDrive += len + 1;
		return true;
	}
	else
		delete [] share_name;

	// Get the label of the drive
	wxChar* pVolumeName = new wxChar[501];
	int oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
	BOOL res = GetVolumeInformation(pDrive, pVolumeName, 500, 0, 0, 0, 0, 0);
	SetErrorMode(oldErrorMode);
	if (res && pVolumeName[0])
	{
		m_crit_section.Enter();
		t_VolumeInfoInternal volumeInfo;
		volumeInfo.pVolume = pVolume;
		volumeInfo.pVolumeName = pVolumeName;
		m_volumeInfo.push_back(volumeInfo);
		m_crit_section.Leave();
		return true;
	}

	delete [] pVolumeName;
	delete [] pVolume;

	return false;
}
开发者ID:AbelTian,项目名称:filezilla,代码行数:50,代码来源:volume_enumerator.cpp


示例13: volume_name

std::string volume_name(const std::string &path)
{
    wchar_t volume_name[MAX_PATH + 1];
    if (GetVolumeInformation(
                to_windows_path(path).c_str(),
                volume_name,
                sizeof(volume_name) / sizeof(*volume_name),
                NULL, NULL, NULL, NULL, 0))
    {
        return from_utf16(volume_name);
    }

    return std::string();
}
开发者ID:darkphase,项目名称:LXiMedia,代码行数:14,代码来源:path.cpp


示例14: Java_sage_Sage_getFileSystemType

/*
 * Class:     sage_Sage
 * Method:    getFileSystemType
 * Signature: (Ljava/lang/String;)Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL Java_sage_Sage_getFileSystemType(JNIEnv *env, jclass jc, jstring volRoot)
{
	const char* rootStr = env->GetStringUTFChars(volRoot, 0);
	DWORD maxNameLen;
	DWORD fsFlags;
	TCHAR daBuf[64];
	jstring rv;
	if (GetVolumeInformation(rootStr, NULL, 0, NULL, &maxNameLen, &fsFlags, daBuf, 64))
		rv = env->NewStringUTF(daBuf);
	else
		rv = NULL;
	env->ReleaseStringUTFChars(volRoot, rootStr);
	return rv;
}
开发者ID:JREkiwi,项目名称:sagetv,代码行数:19,代码来源:SageTVWin32DLL.cpp


示例15: is_ntfs

BOOL
is_ntfs(const char * file) {

    char drive[255];
    char FSType[20];
    char tmpbuf[256];
    char *machinename;
    char *sharename;
    char filename[1024];

    REQUIRE(filename != NULL);

    if (isc_file_absolutepath(file, filename,
                              sizeof(filename)) != ISC_R_SUCCESS) {
        return (FALSE);
    }

    /*
     * Look for c:\path\... style, c:/path/... or \\computer\shar\path...
     * the UNC style file specs
     */
    if (isalpha(filename[0]) && filename[1] == ':' &&
            (filename[2] == '\\' || filename[2] == '/')) {
        strncpy(drive, filename, 3);
        drive[3] = '\0';
    }

    else if ((filename[0] == '\\') && (filename[1] == '\\')) {
        /* Find the machine and share name and rebuild the UNC */
        strcpy(tmpbuf, filename);
        machinename = strtok(tmpbuf, "\\");
        sharename = strtok(NULL, "\\");
        strcpy(drive, "\\\\");
        strcat(drive, machinename);
        strcat(drive, "\\");
        strcat(drive, sharename);
        strcat(drive, "\\");

    }
    else /* Not determinable */
        return (FALSE);

    GetVolumeInformation(drive, NULL, 0, NULL, 0, NULL, FSType,
                         sizeof(FSType));
    if(strcmp(FSType,"NTFS") == 0)
        return (TRUE);
    else
        return (FALSE);
}
开发者ID:ryo,项目名称:netbsd-src,代码行数:49,代码来源:fsaccess.c


示例16: pathconf

/*
 * pathconf -
 *   return:
 *   path(in):
 *   name(in):
 *
 * Note:
 */
long
pathconf (char *path, int name)
{

  long namelen;
  long filesysflags;

  switch (name)
    {
    case _PC_PATH_MAX:
      /*
       * NT and OS/2 file systems claim to be able to handle 255 char
       * file names.  But none of the system calls seem to be able to
       * handle a path of more than 255 chars + 1 NULL.  Nor does there
       * appear to be a system function to return the real max length.
       * MAX_PATH is defined in stdlib.h on the NT system.
       */
      return ((MAX_PATH - 1));

    case _PC_NAME_MAX:
      if (GetVolumeInformation
	  (NULL, NULL, 0, NULL, (LPDWORD) & namelen, (LPDWORD) & filesysflags,
	   NULL, 0))
	{
	  /* WARNING!, for "old" DOS style file systems, namelen will be 12
	   * right now, totaling the 8 bytes for name with the 3 bytes for
	   * for extension plus a dot.  This ISN'T what the caller wants,
	   * It really wants the maximum size of an unqualified pathname.
	   * I'm not sure what this works out to be under the new file system.
	   * We probably need to make a similar adjustment but hopefully
	   * we'll have more breathing room.
	   */
	  if (namelen == 12)
	    namelen = 8;

	  return (namelen);
	}
      else
	{
	  return (8);		/* Length of MSDOS file name */
	}

    case _PC_NO_TRUNC:
      return (TRUE);

    default:
      return (-1);
    }
}
开发者ID:dong1,项目名称:testsize,代码行数:57,代码来源:porting.c


示例17: ves_icall_Mono_Security_Cryptography_KeyPairPersistence_CanSecure

MonoBoolean
ves_icall_Mono_Security_Cryptography_KeyPairPersistence_CanSecure (MonoString *root)
{
#if HOST_WIN32
	gint32 flags;

	/* ACL are nice... unless you have FAT or other uncivilized filesystem */
	if (!GetVolumeInformation (mono_string_chars (root), NULL, 0, NULL, NULL, (LPDWORD)&flags, NULL, 0))
		return FALSE;
	return ((flags & FS_PERSISTENT_ACLS) == FS_PERSISTENT_ACLS);
#else
	/* we assume some kind of security is applicable outside Windows */
	return TRUE;
#endif
}
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:15,代码来源:mono-security.c


示例18: DosQueryFSAttach

APIRET os2APIENTRY DosQueryFSAttach(PCSZ   pszDeviceName,
                                    ULONG  /*ulOrdinal*/,
                                    ULONG  ulFSAInfoLevel,
                                    PFSQBUFFER2 pfsqb,
                                    PULONG /*pcbBuffLength*/)
{
        //FixMe: handle devices too
        if(ulFSAInfoLevel!=FSAIL_QUERYNAME)
                return 124; //invalid level
        UINT dt = GetDriveType(pszDeviceName);
        switch(dt) {
                case DRIVE_REMOVABLE:
                        pfsqb->iType = FSAT_LOCALDRV; break;
                case DRIVE_FIXED:
                        pfsqb->iType = FSAT_LOCALDRV; break;
                case DRIVE_REMOTE:
                        pfsqb->iType = FSAT_REMOTEDRV; break;
                case DRIVE_CDROM:
                        pfsqb->iType = FSAT_LOCALDRV; break;
                case DRIVE_RAMDISK:
                        pfsqb->iType = FSAT_LOCALDRV; break;
                default:
                        return 15; //invalid drive
        }

        char volumeNameBuffer[256];
        DWORD mcl;
        DWORD fsf;
        char fsNameBuffer[256];
        if(!GetVolumeInformation(pszDeviceName,
                                 volumeNameBuffer,
                                 256,
                                 0,
                                 &mcl,
                                 &fsf,
                                 fsNameBuffer,
                                 256
                                ))
                return (APIRET)GetLastError();

        pfsqb->cbName = (USHORT)strlen(fsNameBuffer);
        strcpy((char*)pfsqb->szName,fsNameBuffer);
        pfsqb->cbFSDName = (USHORT)strlen(fsNameBuffer);
        strcpy((char*)pfsqb->szName+pfsqb->cbName+1,fsNameBuffer);
        pfsqb->cbFSAData = 0;

        return 0;
}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:48,代码来源:filemgr4.cpp


示例19: PrintDirectoryHeader

/*
 * PrintDirectoryHeader
 *
 * print the header for the dir command
 */
static BOOL
PrintDirectoryHeader(LPTSTR szPath, LPDIRSWITCHFLAGS lpFlags)
{
  TCHAR szMsg[RC_STRING_MAX_SIZE];
  TCHAR szFullDir[MAX_PATH];
  TCHAR szRootName[MAX_PATH];
  TCHAR szVolName[80];
  LPTSTR pszFilePart;
  DWORD dwSerialNr;

  if (lpFlags->bBareFormat)
    return TRUE;

  if (GetFullPathName(szPath, sizeof(szFullDir) / sizeof(TCHAR), szFullDir, &pszFilePart) == 0)
    {
      ErrorMessage(GetLastError(), _T("Failed to build full directory path"));
      return FALSE;
    }

  if (pszFilePart != NULL)
      *pszFilePart = _T('\0');

  /* get the media ID of the drive */
  if (!GetVolumePathName(szFullDir, szRootName, sizeof(szRootName) / sizeof(TCHAR)) ||
      !GetVolumeInformation(szRootName, szVolName, 80, &dwSerialNr,
			    NULL, NULL, NULL, 0))
    {
      return(TRUE);
    }

  /* print drive info */
  if (szVolName[0] != _T('\0'))
    {
      LoadString(CMD_ModuleHandle, STRING_DIR_HELP2, szMsg, RC_STRING_MAX_SIZE);
      DirPrintf(lpFlags, szMsg, szRootName[0], szVolName);
    }
  else
    {
      LoadString(CMD_ModuleHandle, STRING_DIR_HELP3, szMsg, RC_STRING_MAX_SIZE);
      DirPrintf(lpFlags, szMsg, szRootName[0]);
    }

  /* print the volume serial number if the return was successful */
  LoadString(CMD_ModuleHandle, STRING_DIR_HELP4, (LPTSTR) szMsg, RC_STRING_MAX_SIZE);
  DirPrintf(lpFlags, szMsg, HIWORD(dwSerialNr), LOWORD(dwSerialNr));

  return TRUE;
}
开发者ID:RareHare,项目名称:reactos,代码行数:53,代码来源:dir.c


示例20: GetSystemVolumeSerial

DWORD GetSystemVolumeSerial(char *szSystemVolume)
{
	char *lpszVolumeName, *lpszFileSystemName;
	DWORD dwVolumeSerialNumber = 0xFFFFFFFF, dwMaximumComponentLength, dwFileSystemFlags;

	lpszVolumeName = (char *)malloc(MAX_PATH + 1);
	if(lpszVolumeName != NULL){
		lpszFileSystemName = (char *)malloc(MAX_PATH * 1);
		if(lpszFileSystemName != NULL){
			GetVolumeInformation(szSystemVolume, lpszVolumeName, MAX_PATH + 1, &dwVolumeSerialNumber, &dwMaximumComponentLength, &dwFileSystemFlags, lpszFileSystemName, MAX_PATH + 1);
			free(lpszFileSystemName);
		}
		free(lpszVolumeName);
	}
	return dwVolumeSerialNumber;
}
开发者ID:n0rmen,项目名称:KeygenMe,代码行数:16,代码来源:Keygen.cpp



注:本文中的GetVolumeInformation函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetWarnings函数代码示例发布时间:2022-05-30
下一篇:
C++ GetVolume函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap