1.安装Realtek HD Audio Driver 失败,设备管理器声卡处会显示"Microsoft HD Audio",无法卸载。
2.设备管理器声卡处显示Audio Device on High Definition Audio Bus,且为问号或感叹号,如下图:
且装声卡驱动时也提示安装失败!
问题分析:要解决问题首先要知道其原理,先说一下 HD Audio的原理.
HD Audio是High Definition Audio(高保真音频)的缩写,原称Azalia,是Intel与杜比(Dolby)公司合力推出的新一代音频规范.HD Audio的制定是为了取代目前的AC’97音频规范,与AC’97有许多共通之处,某种程序上可以说是AC’97的增强版,但并不能向下兼容AC’97标准.它在AC’97的基础上提供了全新的连接总路线,支持更高品质的音频以及更多的功能.与现行的AC’97相比,HD Audio具有数据传输带宽大、音频回放精度高、支持多声道阵列麦克风音频输入、CPU的占用率更低和底层驱动程序可以通用等特点.HD Audio是把驱动分为两层:总线驱(Bus Driver)和功能驱动(Function Drivers),其中"总线驱动"是实现最基本音频功能驱动,将统一集成在操作系统中.目前在Windows XP, Windows Server 2003, and Windows 2000系统中是微软提供的HD Audio Bus Driver,一般称之为通用音频结构(UAA)高清晰度音频类驱动程序."功能驱动"是实现特殊功能的功能性驱动,包括音频控制面板软件一般由CODEC
芯片厂商提供.
问题就是这样产生的:当系统搜索到HD芯片会安装系统自带的总线驱动,之后如果芯片厂的HD驱动中除了功能驱动外也包含总路线驱动,冲突就来了.就像Realtek的HD声卡驱动在Windows HD总线存在的情况下安装会提示"Audio HD Driver安装失败"的消息,而设备管理器声卡处会显示"Microsoft HD Audio"无法卸载,不提供音频功能 ,且修复此Bug的KB888111补丁于05年1月发布之前已经存在于系统中了,只能卸载一次,意味着不可能通过删除补丁的方法删除总线驱动.再如重装系统时,如果先将Windows的HD总线装好后再装声卡驱动,也会发生些类问题.
# MySQL Server Instance Configuration File # ———————————————————————- # Generated by the MySQL Server Instance Configuration Wizard # # # Installation Instructions # ———————————————————————- # # On Linux you can copy this file to /etc/my.cnf to set global options, # mysql-data-dir/my.cnf to set server-specific options # (@localstatedir@ for this installation) or to # ~/.my.cnf to set user-specific options. # # On Windows you should keep this file in the installation directory # of your server (e.g. C:\Program Files\MySQL\MySQL Server 4.1). To # make sure the server reads the config file use the startup option # “–defaults-file”. # # To run run the server from the command line, execute this in a # command line shell, e.g. # mysqld –defaults-file=”C:\Program Files\MySQL\MySQL Server 4.1\my.ini” # # To install the server as a Windows service manually, execute this in a # command line shell, e.g. # mysqld –install MySQL41 –defaults-file=”C:\Program Files\MySQL\MySQL Server 4.1\my.ini” # # And then execute this in a command line shell to start the server, e.g. # net start MySQL41 # # # Guildlines for editing this file # ———————————————————————- # # In this file, you can use all long options that the program supports. # If you want to know the options a program supports, start the program # with the “–help” option. # # More detailed information about the individual options can also be # found in the manual. # # # CLIENT SECTION # ———————————————————————- # # The following options will be read by MySQL client applications. # Note that only client applications shipped by MySQL are guaranteed # to read this section. If you want your own MySQL client program to # honor these values, you need to specify it as an option during the # MySQL client library initialization. # [client]
port=3306
[mysql]
default-character-set=latin1
# SERVER SECTION # ———————————————————————- # # The following options will be read by the MySQL Server. Make sure that # you have installed the server correctly (see above) so it reads this # file. # [mysqld]
# The TCP/IP Port the MySQL Server will listen on port=3306
#Path to installation directory. All paths are usually resolved relative to this. basedir=”C:/Program Files/MySQL/MySQL Server 5.0/”
#Path to the database root datadir=”C:/Program Files/MySQL/MySQL Server 5.0/Data/”
# The default character set that will be used when a new schema or table is # created and no character set is defined default-character-set=latin1
# The default storage engine that will be used when create new tables when default-storage-engine=INNODB
# Set the SQL mode to strict sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”
# The maximum amount of concurrent sessions the MySQL server will # allow. One of these connections will be reserved for a user with # SUPER privileges to allow the administrator to login even if the # connection limit has been reached. max_connections=100
# Query cache is used to cache SELECT results and later return them # without actual executing the same query once again. Having the query # cache enabled may result in significant speed improvements, if your # have a lot of identical queries and rarely changing tables. See the # “Qcache_lowmem_prunes” status variable to check if the current value # is high enough for your load. # Note: In case your tables change very often or if your queries are # textually different every time, the query cache may result in a # slowdown instead of a performance improvement. query_cache_size=0
# The number of open tables for all threads. Increasing this value # increases the number of file descriptors that mysqld requires. # Therefore you have to make sure to set the amount of open files # allowed to at least 4096 in the variable “open-files-limit” in # section [mysqld_safe] table_cache=256
# Maximum size for internal (in-memory) temporary tables. If a table # grows larger than this value, it is automatically converted to disk # based table This limitation is for a single table. There can be many # of them. tmp_table_size=5M
# How many threads we should keep in a cache for reuse. When a client # disconnects, the client’s threads are put in the cache if there aren’t # more than thread_cache_size threads from before. This greatly reduces # the amount of thread creations needed if you have a lot of new # connections. (Normally this doesn’t give a notable performance # improvement if you have a good thread implementation.) thread_cache_size=8
#*** MyISAM Specific options
# The maximum size of the temporary file MySQL is allowed to use while # recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE. # If the file-size would be bigger than this, the index will be created # through the key cache (which is slower). myisam_max_sort_file_size=100G
# If the temporary file used for fast index creation would be bigger # than using the key cache by the amount specified here, then prefer the # key cache method. This is mainly used to force long character keys in # large tables to use the slower key cache method to create the index. myisam_max_extra_sort_file_size=100G
# If the temporary file used for fast index creation would be bigger # than using the key cache by the amount specified here, then prefer the # key cache method. This is mainly used to force long character keys in # large tables to use the slower key cache method to create the index. myisam_sort_buffer_size=8M
# Size of the Key Buffer, used to cache index blocks for MyISAM tables. # Do not set it larger than 30% of your available memory, as some memory # is also required by the OS to cache rows. Even if you’re not using # MyISAM tables, you should still set it to 8-64M as it will also be # used for internal temporary disk tables. key_buffer_size=8M
# Size of the buffer used for doing full table scans of MyISAM tables. # Allocated per thread, if a full scan is needed. read_buffer_size=64K read_rnd_buffer_size=256K
# This buffer is allocated when MySQL needs to rebuild the index in # REPAIR, OPTIMZE, ALTER table statements as well as in LOAD DATA INFILE # into an empty table. It is allocated per thread so be careful with # large settings. sort_buffer_size=212K
#*** INNODB Specific options ***
# Use this option if you have a MySQL server with InnoDB support enabled # but you do not plan to use it. This will save memory and disk space # and speed up some things. #skip-innodb
# Additional memory pool
that is used by InnoDB to store metadata # information. If InnoDB requires more memory for this purpose it will # start to allocate it from the OS. As this is fast enough on most # recent operating systems, you normally do not need to change this # value. SHOW INNODB STATUS will display the current amount used. innodb_additional_mem_pool_size=2M
# If set to 1, InnoDB will flush (fsync) the transaction logs to the # disk at each commit, which offers full ACID behavior. If you are # willing to compromise this safety, and you are running small # transactions, you may set this to 0 or 2 to reduce disk I/O to the # logs. Value 0 means that the log is only written to the log file and # the log file flushed to disk approximately once per second. Value 2 # means the log is written to the log file at each commit, but the log # file is only flushed to disk approximately once per second. innodb_flush_log_at_trx_commit=1
# The size of the buffer InnoDB uses for buffering log data. As soon as # it is full, InnoDB will have to flush it to disk. As it is flushed # once per second anyway, it does not make sense to have it very large # (even with long transactions). innodb_log_buffer_size=1M
# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and # row data. The bigger you set this the less disk I/O is needed to # access data in tables. On a dedicated database server you may set this # parameter up to 80% of the machine physical memory size. Do not set it # too large, though, because competition of the physical memory may # cause paging in the operating system. Note that on 32bit systems you # might be limited to 2-3.5G of user level memory per process, so do not # set it too high. innodb_buffer_pool_size=8M
# Size of each log file in a log group. You should set the combined size # of log files to about 25%-100% of your buffer pool size to avoid # unneeded buffer pool flush activity on log file overwrite. However, # note that a larger logfile size will increase the time needed for the # recovery process. innodb_log_file_size=10M
# Number of threads allowed inside the InnoDB kernel. The optimal value # depends highly on the application, hardware as well as the OS # scheduler properties. A too high value may lead to thread thrashing. innodb_thread_concurrency=8
本实验在Windows Vista Build 5231上进行,测试帐户为TestAdmin,是管理员组成员。为了查看进程的访问令牌,需要借助聪明人Mark所提供的Process Explorer工具(这个工具实在太好了,我们经常用它来查看IE浏览器所加载的dll文件,以便进行排错),下载地址如下:http://www.sysinternals.com/Utilities/ProcessExplorer.html。
要能够修改系统时间,只需单击“时间和日期”窗口右下侧的“Unlock”按钮,即可打开对话框,同时可以看到系统启动了一个consent进程。单击“I want to complete this action”选项,现在应该可以修改系统时间了。看来这个consent进程负责传递消息,以便系统确认提升操作权限。其本质应该是修改相关进程的访问令牌,对于本例来说,应该是在相关进程的安全令牌里添加SeSystemTimePrivilege特权。
反复重新做实验后,终于发现,单击“I want to complete this action”选项后,系统会新增一个dllhost进程(在Process Explorer中绿色显示),在dllhost进程属性对话框的“Image”标签页的“Command Line”文本框里可以看到“/Processid: {9DF523B0-A6C0-4EA9-B5F1-F4565C3AC8B8}”参数。搜索注册表得知,{9DF523B0-A6C0-4EA9-B5F1-F4565C3AC8B8}就是timedate.cpl的AppID。
public int getPercent() { if (totalSize == 0) return 0; else return (int) (currSize * 100 / totalSize); }
public String getTimeElapsed() { long time = (System.currentTimeMillis() – starttime) / 1000l; if (time – 60l >= 0){ if (time % 60 >=10) return time / 60 + “:” + (time % 60) + “m”; else return time / 60 + “:0″ + (time % 60) + “m”; } else return time<10 ? "0" + time + "s": time + "s"; }
public String getTimeEstimated() { if (currSize == 0) return “n/a”; long time = System.currentTimeMillis() – starttime; time = totalSize * time / currSize; time /= 1000l; if (time – 60l >= 0){ if (time % 60 >=10) return time / 60 + “:” + (time % 60) + “m”; else return time / 60 + “:0″ + (time % 60) + “m”; } else return time<10 ? "0" + time + "s": time + "s"; }
}
public class FileInfo {
public String name = null, clientFileName = null, fileContentType = null; private byte[] fileContents = null; public File file = null; public StringBuffer sb = new StringBuffer(100);
public void setFileContents(byte[] aByteArray) { fileContents = new byte[aByteArray.length]; System.arraycopy(aByteArray, 0, fileContents, 0, aByteArray.length); } }
// A Class with methods used to process a ServletInputStream public class HttpMultiPartParser {
private final String lineSeparator = System.getProperty(“line.separator”, “\n”); private final int ONE_MB = 1024 * 1;
public Hashtable processData(ServletInputStream is, String boundary, String saveInDir, int clength) throws IllegalArgumentException, IOException { if (is == null) throw new IllegalArgumentException(“InputStream”); if (boundary == null || boundary.trim().length() < 1) throw new IllegalArgumentException( ”\”" + boundary + “\” is an illegal boundary indicator”); boundary = “–” + boundary; StringTokenizer stLine = null, stFields = null; FileInfo fileInfo = null; Hashtable dataTable = new Hashtable(5); String line = null, field = null, paramName = null; boolean saveFiles = (saveInDir != null && saveInDir.trim().length() > 0); boolean isFile = false; if (saveFiles) { // Create the required directory (including parent dirs) File f = new File(saveInDir); f.mkdirs(); } line = getLine(is); if (line == null || !line.startsWith(boundary)) throw new IOException( ”Boundary not found; boundary = ” + boundary + “, line = ” + line); while (line != null) { if (line == null || !line.startsWith(boundary)) return dataTable; line = getLine(is); if (line == null) return dataTable; stLine = new StringTokenizer(line, “;\r\n”); if (stLine.countTokens() < 2) throw new IllegalArgumentException( “Bad data in second line”); line = stLine.nextToken().toLowerCase(); if (line.indexOf(“form-data”) < 0) throw new IllegalArgumentException( “Bad data in second line”); stFields = new StringTokenizer(stLine.nextToken(), “=\”"); if (stFields.countTokens() < 2) throw new IllegalArgumentException( “Bad data in second line”); fileInfo = new FileInfo(); stFields.nextToken(); paramName = stFields.nextToken(); isFile = false; if (stLine.hasMoreTokens()) { field = stLine.nextToken(); stFields = new StringTokenizer(field, “=\”"); if (stFields.countTokens() > 1) { if (stFields.nextToken().trim().equalsIgnoreCase(“filename”)) { fileInfo.name = paramName; String value = stFields.nextToken(); if (value != null && value.trim().length() > 0) { fileInfo.clientFileName = value; isFile = true; } else { line = getLine(is); // Skip “Content-Type:” line line = getLine(is); // Skip blank line line = getLine(is); // Skip blank line line = getLine(is); // Position to boundary line continue; } } } else if (field.toLowerCase().indexOf(“filename”) >= 0) { <
br/> line = getLine(is); // Skip “Content-Type:” line line = getLine(is); // Skip blank line line = getLine(is); // Skip blank line line = getLine(is); // Position to boundary line continue; } } boolean skipBlankLine = true; if (isFile) { line = getLine(is); if (line == null) return dataTable; if (line.trim().length() < 1) skipBlankLine = false; else { stLine = new StringTokenizer(line, “: “); if (stLine.countTokens() < 2) throw new IllegalArgumentException( “Bad data in third line”); stLine.nextToken(); // Content-Type fileInfo.fileContentType = stLine.nextToken(); } } if (skipBlankLine) { line = getLine(is); if (line == null) return dataTable; } if (!isFile) { line = getLine(is); if (line == null) return dataTable; dataTable.put(paramName, line); // If parameter is dir, change saveInDir to dir if (paramName.equals(“dir”)) saveInDir = line; line = getLine(is); continue; } try { UplInfo uplInfo = new UplInfo(clength); UploadMonitor.set(fileInfo.clientFileName, uplInfo); OutputStream os = null; String path = null; if (saveFiles) os = new FileOutputStream(path = getFileName(saveInDir, fileInfo.clientFileName)); else os = new ByteArrayOutputStream(ONE_MB); boolean readingContent = true; byte previousLine[] = new byte[2 * ONE_MB]; byte temp[] = null; byte currentLine[] = new byte[2 * ONE_MB]; int read, read3; if ((read = is.readLine(previousLine, 0, previousLine.length)) == -1) { line = null; break; } while (readingContent) { if ((read3 = is.readLine(currentLine, 0, currentLine.length)) == -1) { line = null; uplInfo.aborted = true; break; } if (compareBoundary(boundary, currentLine)) { os.write(previousLine, 0, read – 2); line = new String(currentLine, 0, read3); break; } else { os.write(previousLine, 0, read); uplInfo.currSize += read; temp = currentLine; currentLine = previousLine; previousLine = temp; read = read3; }//end else }//end while os.flush(); os.close(); if (!saveFiles) { ByteArrayOutputStream baos = (ByteArrayOutputStream) os; fileInfo.setFileContents(baos.toByteArray()); } else fileInfo.file = new File(path); dataTable.put(paramName, fileInfo); uplInfo.currSize = uplInfo.totalSize; }//end try catch (IOException e) { throw e; } } return dataTable; }
/** * Compares boundary string to byte array */ private boolean compareBoundary(String boundary, byte ba[]) { byte b; if (boundary == null || ba == null) return false; for (int i = 0; i < boundary.length(); i++) if ((byte) boundary.charAt(i) != ba[i]) return false; return true; }
/** Convenience method to read HTTP header lines */ private synchronized String getLine(ServletInputStream sis) throws IOException { byte b[] = new byte[1024]; int read = sis.readLine(b, 0, b.length), index; String line = null; if (read != -1) { line = new String(b, 0, read); if ((index = line.indexOf(‘\n’)) >= 0) line = line.substring(0, index – 1); } return line; }
public String getFileName(String dir, String fileName) throws IllegalArgumentException { String path = null; if (dir == null || fileName == null) throw new IllegalArgumentException( ”dir or fileName is null”); int index = fileName.lastIndexOf(‘/’); String name = null; if (index >= 0) name = fileName.substring(index + 1); else name = fileName; index = name.lastIndexOf(‘\\’); if (index >= 0) fileName = name.substring(index + 1); path = dir + File.separator + fileName; if (File.separatorChar == ‘/’) return path.replace(‘\\’, File.separatorChar); else return path.replace(‘/’, File.separatorChar); } } //End of class HttpMultiPartParser
String formatPath(String p) { StringBuffer sb=new StringBuffer(); for (int i = 0; i < p.length(); i++) { if(p.charAt(i)==’\\’) { sb.append(“\\\\”); } else { sb.append(p.charAt(i)); } } return sb.toString(); }
/** * Converts some important chars (int) to the corresponding html string */ static String conv2Html(int i) { if (i == ‘&’) return “&”; else if (i == ‘<') return "<"; else if (i == ‘>’) return “>”; else if (i == ‘”‘) return “"”; else return “” + (char) i; }