hotspot/src/os/windows/vm/os_windows.cpp
changeset 950 6112b627bb36
parent 823 9a5271881bc0
child 981 29e21b1b7602
equal deleted inserted replaced
823:9a5271881bc0 950:6112b627bb36
   983       path_buf[0]='\0';
   983       path_buf[0]='\0';
   984       return path_buf;
   984       return path_buf;
   985     }
   985     }
   986 }
   986 }
   987 
   987 
       
   988 void os::dll_build_name(char *holder, size_t holderlen,
       
   989                         const char* pname, const char* fname)
       
   990 {
       
   991     // copied from libhpi
       
   992     const size_t pnamelen = pname ? strlen(pname) : 0;
       
   993     const char c = (pnamelen > 0) ? pname[pnamelen-1] : 0;
       
   994 
       
   995     /* Quietly truncates on buffer overflow. Should be an error. */
       
   996     if (pnamelen + strlen(fname) + 10 > holderlen) {
       
   997         *holder = '\0';
       
   998         return;
       
   999     }
       
  1000 
       
  1001     if (pnamelen == 0) {
       
  1002         sprintf(holder, "%s.dll", fname);
       
  1003     } else if (c == ':' || c == '\\') {
       
  1004         sprintf(holder, "%s%s.dll", pname, fname);
       
  1005     } else {
       
  1006         sprintf(holder, "%s\\%s.dll", pname, fname);
       
  1007     }
       
  1008 }
       
  1009 
   988 // Needs to be in os specific directory because windows requires another
  1010 // Needs to be in os specific directory because windows requires another
   989 // header file <direct.h>
  1011 // header file <direct.h>
   990 const char* os::get_current_directory(char *buf, int buflen) {
  1012 const char* os::get_current_directory(char *buf, int buflen) {
   991   return _getcwd(buf, buflen);
  1013   return _getcwd(buf, buflen);
   992 }
  1014 }
  1244   // for every module. That's too much work to do after a fatal error.
  1266   // for every module. That's too much work to do after a fatal error.
  1245   // For an example on how to implement this function, see 1.4.2.
  1267   // For an example on how to implement this function, see 1.4.2.
  1246   if (offset)  *offset  = -1;
  1268   if (offset)  *offset  = -1;
  1247   if (buf) buf[0] = '\0';
  1269   if (buf) buf[0] = '\0';
  1248   return false;
  1270   return false;
       
  1271 }
       
  1272 
       
  1273 void* os::dll_lookup(void* handle, const char* name) {
       
  1274   return GetProcAddress((HMODULE)handle, name);
  1249 }
  1275 }
  1250 
  1276 
  1251 // save the start and end address of jvm.dll into param[0] and param[1]
  1277 // save the start and end address of jvm.dll into param[0] and param[1]
  1252 static int _locate_jvm_dll(int pid, char* mod_fname, address base_addr,
  1278 static int _locate_jvm_dll(int pid, char* mod_fname, address base_addr,
  1253                     unsigned size, void * param) {
  1279                     unsigned size, void * param) {